Suggestion: creation of a generic collection type

Abierto
#530 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
typescript
Área
api

Línea de trabajo

Start by reading the TypeScript definitions for collection response types and the Client.api(...).get() typing used for /me/events. Check how existing collection types represent their value arrays and whether they can be generalized for different item types. Done means the typings expose a reusable generic collection type and the event response can use it; the issue names no files or tests.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi,

So I am doing requests to retrieve an array of events, and I noticed that there aren't many types for collections.
If i do the following:

const options = {
	authProvider,
};
const client = Client.init(options);
let events = await client.api('/me/events').get();

Then events will be an object with the property value being an array of events.
Maybe this could be added to the typings to solve this:

export interface GenericCollection<T> {
  value?: NullableOption<Array<T>>;
}

Where T could be any type that has support for lists which could be declared using a type to limit the options.

Hope this is a good idea?

Lenguaje dominante
PowerShell
Estrellas
129
Forks
35
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoftgraph/msgraph-typescript-typings

Todos los issues de microsoftgraph/msgraph-typescript-typings

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.