/** * @license * Copyright Andrey Chalkin (https://github.com/L2jLiga). All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/L2jLiga/fastify-decorators/blob/master/LICENSE */ import { FastifyInstance } from 'fastify'; import { CREATOR, INITIALIZER } from '../symbols/index.js'; import { DESTRUCTOR } from '../symbols/index.js'; import { ClassLoader } from './bootstrap-config.js'; export interface InjectableService extends InjectableClass, Object { [CREATOR]: { register(classLoader: ClassLoader): Type; }; [INITIALIZER]?(self: Type): Promise; [DESTRUCTOR]?: string | symbol; } export interface InjectableController extends InjectableClass { [CREATOR]: { register(instance?: FastifyInstance, prefix?: string, classLoader?: ClassLoader): Promise; }; } export interface InjectableClass { new (): any; new (...args: unknown[]): any; }