jimpex
    Preparing search index...

    Variable commonServicesProviderConst

    commonServicesProvider: {
        appErrorProvider: Resource<
            "provider",
            "register",
            ProviderRegisterFn<Jimpex>,
        >;
        httpErrorProvider: Resource<
            "provider",
            "register",
            ProviderRegisterFn<Jimpex>,
        >;
        sendFileProvider: Resource<
            "provider",
            "register",
            ProviderRegisterFn<Jimpex>,
        >;
    } & Record<
        string,
        Resource<"provider", "register", ProviderRegisterFn<Jimpex>>,
    > & { provider: true } & { register: ProviderRegisterFn<Jimpex> } & Record<
        string,
        unknown,
    > = ...

    Registers all the common services on the container.

    Type Declaration

    • appErrorProvider: Resource<"provider", "register", ProviderRegisterFn<Jimpex>>

      A service provider that will register both, AppError and createAppError, on the container. AppError will be the key for class, and appError will be for the generator function.

      // Register it on the container
      container.register(appErrorProvider);
      // Getting access to the class.
      const AppError = container.get<AppErrorClass>('AppError');
      // Getting access to the function.
      const appError = container.get<CreateAppErrorFn>('appError');
    • httpErrorProvider: Resource<"provider", "register", ProviderRegisterFn<Jimpex>>

      A service provider that will register both the HTTPError and a generator function on the container. HTTPError will be the key for class, and httpError will be for the generator function.

      // Register it on the container
      container.register(httpErrorProvider);
      // Getting access to the class.
      const HTTPError = container.get<HTTPErrorClass>('HTTPError');
      // Getting access to the function.
      const httpError = container.get<CreateHTTPErrorFn>('httpError');
    • sendFileProvider: Resource<"provider", "register", ProviderRegisterFn<Jimpex>>

      The service provider that once registered on the container will set the result of sendFile as the sendFile service.

      // Register it on the container
      container.register(sendFileProvider);
      // Getting access to the service instance
      const sendFile = container.get<SendFile>('sendFile');
    • provider: true
    • register: ProviderRegisterFn<Jimpex>
    // Register the collection on the container
    container.register(commonServicesProvider);
    // Getting access to one the services instance
    const sendFile = container.get<SendFile>('sendFile');