From 90dbdf4c883b20d781cf7830827201bcc77fb4a5 Mon Sep 17 00:00:00 2001 From: robonen Date: Sat, 30 Nov 2024 04:24:49 +0700 Subject: [PATCH] feat(packages/stdlib): add promise types --- packages/stdlib/src/types/ts/index.ts | 5 +++-- packages/stdlib/src/types/ts/promise.ts | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 packages/stdlib/src/types/ts/promise.ts diff --git a/packages/stdlib/src/types/ts/index.ts b/packages/stdlib/src/types/ts/index.ts index c4cbedb..1b8ba93 100644 --- a/packages/stdlib/src/types/ts/index.ts +++ b/packages/stdlib/src/types/ts/index.ts @@ -1,3 +1,4 @@ -export * from './string'; +export * from './array'; export * from './function'; -export * from './array'; \ No newline at end of file +export * from './promise'; +export * from './string'; diff --git a/packages/stdlib/src/types/ts/promise.ts b/packages/stdlib/src/types/ts/promise.ts new file mode 100644 index 0000000..dd1b93c --- /dev/null +++ b/packages/stdlib/src/types/ts/promise.ts @@ -0,0 +1,4 @@ +/** + * Represents a value that may be a promise. + */ +export type MaybePromise = T | Promise;