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 { Server } from './strapi-server';
export * from './strapi-admin';
export * from './strapi-server';

View File

@ -3,12 +3,11 @@ import { Routes } from './routes';
import { ContentTypes } from './content-types';
import { Controllers } from './controllers';
import { Register, Bootstrap, Destroy } from './lifecycle';
import { LoadedStrapi } from '../../../../..';
export interface ServerObject<TStrapi> {
register: Register<TStrapi>;
bootstrap: Bootstrap<TStrapi>;
destroy: Destroy<TStrapi>;
export interface ServerObject {
register: Register;
bootstrap: Bootstrap;
destroy: Destroy;
config: Config;
routes: Routes;
contentTypes: ContentTypes;
@ -20,7 +19,7 @@ export interface ServerObject<TStrapi> {
middlewares: any;
}
export type ServerFunction<TStrapi> = () => ServerObject<TStrapi>;
export type ServerFunction = () => ServerObject;
// 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> = ({
strapi,
}: {
strapi: TStrapi;
}) => Promise<unknown> | unknown;
import { Strapi } from '../../../../..';
export type Register<TStrapi> = LifecycleMethod<TStrapi>;
export type Bootstrap<TStrapi> = LifecycleMethod<TStrapi>;
export type Destroy<TStrapi> = LifecycleMethod<TStrapi>;
export type LifecycleMethod = ({ strapi }: { strapi: Strapi }) => Promise<unknown> | unknown;
export type Register = LifecycleMethod;
export type Bootstrap = LifecycleMethod;
export type Destroy = LifecycleMethod;