strapi-plugin-gen-types
Version:
Generate types for the different collections, single types & components found in your application
24 lines (23 loc) • 2.16 kB
TypeScript
/**
* The fields that are usually always added to the top of a model
*/
export declare const metaFields = "\n id?: number;\n documentId?: string;\n createdAt?: Date | string;\n updatedAt?: Date | string;\n publishedAt?: Date | string;\n locale?: string | null;\n";
/**
* The shape of the default strapi user
*/
export declare const userFields = "export interface User {\n id?: number;\n username: string;\n email: string;\n provider?: string;\n confirmed?: boolean;\n blocked?: boolean;\n createdAt?: Date | string;\n updatedAt?: Date | string;\n role: Role | null | number;\n};\n";
/**
* The shape of the default strapi role
*
* For v4, the `documentId` field is not there
*/
export declare const roleFields = "export interface Role {\n id?: number;\n documentId?: string;\n createdAt?: Date | string;\n updatedAt?: Date | string;\n name: string;\n description: string;\n type: string;\n};\n";
/**
* The shape of the payload returned from a findOne query
*/
export declare const findOnePayload = "export interface FindOne<T> {\n data: T;\n meta: {\n pagination?: {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n }\n };\n};\n";
/**
* The shape of the payload returned from a findMany query
*/
export declare const findManyPayload = "export interface FindMany<T> {\n data: T[];\n meta: {\n pagination?: {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n }\n };\n};\n";
export declare const mediaFields = "export interface Media {\n id: number;\n name: string;\n alternativeText: string;\n caption: string;\n width: number;\n height: number;\n formats: { thumbnail: MediaFormat; small: MediaFormat; medium: MediaFormat; large: MediaFormat; };\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string;\n provider: string;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface MediaFormat {\n name: string;\n hash: string;\n ext: string;\n mime: string;\n width: number;\n height: number;\n size: number;\n path: string;\n url: string;\n}\n";