First check-in of the code from the Obsidian Prj project.

This commit is contained in:
2024-08-14 19:40:52 +02:00
parent 1341427590
commit 6c4db19926
14 changed files with 495 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
/**
* Generic constructor type.
*/
export type GenericConstructor<
T extends abstract new (...args: unknown[]) => InstanceType<T>,
> = new (...args: ConstructorParameters<T>) => T;
/**
* Force generic constructor type.
* This type is used to force a class to be a constructor.
*/
export type ForceConstructor<T> = new (...args: unknown[]) => T;

View File

@@ -0,0 +1,9 @@
/**
* A function type representing an initializer that transforms an input of type `T`
* into an output of type `U`.
* @template T - The type of the input parameter.
* @template U - The type of the output parameter.
* @param x - The input parameter of type `T`.
* @returns The transformed output of type `U`.
*/
export type InitDelegate<T, U> = (x: T) => U;