From 2259c2c68bcc07fac167d533fd136d8a00918691 Mon Sep 17 00:00:00 2001 From: Noel Date: Tue, 1 Jun 2021 11:52:05 -0700 Subject: [PATCH] bap pawbs --- index.d.ts | 39 ++++++++++++++++++++++++++++++++------ src/utils/isServiceLike.ts | 2 +- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/index.d.ts b/index.d.ts index ba86559..224402b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -24,7 +24,34 @@ import { Collection } from '@augu/collections'; import { EventBus } from '@augu/utils'; /** Represents the entrypoint of @augu/lilith */ -declare namespace Lilith { +declare namespace lilith { + // ~ Namespaces ~ + export namespace utils { + /** + * Checks if [value] is a [[BaseComponent]] or not. + * @param value The value to use + */ + export function isComponentLike(value: unknown): value is BaseComponent; + + /** + * Checks if [value] is a [[BaseService]] or not. + * @param value The value to use + */ + export function isServiceLike(value: unknown): value is BaseService; + + /** + * Returns the default export (if any). + * @param value The value to use + */ + export function returnFromExport(value: T): ImportedDefaultExport; + + /** + * Returns a boolean value if `value` is not a primitive. + * @param value The value to check + */ + export function isPrimitive(value: unknown): boolean; + } + // ~ Constants ~ /** Returns the version of Lilith */ export const version: string; @@ -34,14 +61,14 @@ declare namespace Lilith { * Represents a "container" of components, singletons, and services. This is the main * entrypoint to Lilith, this is your creation tool to create your application! **(\*≧∀≦\*)** */ - export class Container extends EventBus { + export class Container extends EventBus { /** * Represents a "container" of components, singletons, and services. This is the main * entrypoint to Lilith, this is your creation tool to create your application! **(\*≧∀≦\*)** * * @param options Any additional options to use */ - constructor(options?: Lilith.ContainerOptions); + constructor(options?: lilith.ContainerOptions); /** * Returns the component tree @@ -81,7 +108,7 @@ declare namespace Lilith { * @param target The target to inject the value. * @param pending The pending injections */ - public inject(target: any, pending: Lilith.PendingInjectDefinition): void; + public inject(target: any, pending: lilith.PendingInjectDefinition): void; /** * Registers a singleton to this [[Container]] @@ -645,5 +672,5 @@ declare namespace Lilith { } } -export = Lilith; -export as namespace Lilith; +export = lilith; +export as namespace lilith; diff --git a/src/utils/isServiceLike.ts b/src/utils/isServiceLike.ts index f19fe7f..21b5500 100644 --- a/src/utils/isServiceLike.ts +++ b/src/utils/isServiceLike.ts @@ -31,6 +31,6 @@ export function isServiceLike(value: unknown): value is BaseService { return ( utils.isObject(value) && typeof value.type === 'string' && - value.type === 'component' + value.type === 'service' ); }