remove TStrapi

This commit is contained in:
Bassel 2023-09-12 12:30:34 +03:00
parent 70ca791274
commit 7c71ea3de2
3 changed files with 14 additions and 17 deletions

View File

@ -1,2 +1,2 @@
export { Admin } from './strapi-admin'; export * from './strapi-admin';
export { Server } from './strapi-server'; export * from './strapi-server';

View File

@ -3,12 +3,11 @@ import { Routes } from './routes';
import { ContentTypes } from './content-types'; import { ContentTypes } from './content-types';
import { Controllers } from './controllers'; import { Controllers } from './controllers';
import { Register, Bootstrap, Destroy } from './lifecycle'; import { Register, Bootstrap, Destroy } from './lifecycle';
import { LoadedStrapi } from '../../../../..';
export interface ServerObject<TStrapi> { export interface ServerObject {
register: Register<TStrapi>; register: Register;
bootstrap: Bootstrap<TStrapi>; bootstrap: Bootstrap;
destroy: Destroy<TStrapi>; destroy: Destroy;
config: Config; config: Config;
routes: Routes; routes: Routes;
contentTypes: ContentTypes; contentTypes: ContentTypes;
@ -20,7 +19,7 @@ export interface ServerObject<TStrapi> {
middlewares: any; middlewares: any;
} }
export type ServerFunction<TStrapi> = () => ServerObject<TStrapi>; export type ServerFunction = () => ServerObject;
// Interface for the plugin strapi-server file // Interface for the plugin strapi-server file
export type Server<TStrapi = LoadedStrapi> = ServerObject<TStrapi> | ServerFunction<TStrapi>; export type Server = ServerObject | ServerFunction;

View File

@ -1,9 +1,7 @@
export type LifecycleMethod<TStrapi> = ({ import { Strapi } from '../../../../..';
strapi,
}: {
strapi: TStrapi;
}) => Promise<unknown> | unknown;
export type Register<TStrapi> = LifecycleMethod<TStrapi>; export type LifecycleMethod = ({ strapi }: { strapi: Strapi }) => Promise<unknown> | unknown;
export type Bootstrap<TStrapi> = LifecycleMethod<TStrapi>;
export type Destroy<TStrapi> = LifecycleMethod<TStrapi>; export type Register = LifecycleMethod;
export type Bootstrap = LifecycleMethod;
export type Destroy = LifecycleMethod;