feat: version 2 beta

This commit is contained in:
2025-04-25 22:39:47 +00:00
commit 1e58359905
75 changed files with 6899 additions and 0 deletions

32
types/common.ts Normal file
View File

@@ -0,0 +1,32 @@
/**
* Represents an empty object.
*/
export type Empty = Record<string, never>;
/**
* Represent an unknown object.
*/
export type Unknown = Record<string, unknown>;
/**
* Represents a subscription that exposes a way to unsubscribe.
*
* @example
*
* ```ts
* function subscribe(): Subscription {
* const interval = setInterval(() => console.log("foo"), 1000);
* return {
* unsubscribe() {
* clearInterval(interval);
* }
* }
* }
* ```
*/
export type Subscription = {
/**
* Gracefully terminate a decoupled subscriber.
*/
unsubscribe: () => void;
};