@little-nebulae/clack 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { CANCEL_SYMBOL, ConfirmOptions, MultiLineOptions, PathOptions, SelectOptions, TextOptions } from "@clack/prompts";
|
|
2
2
|
import { UnexpectedError } from "@little-nebulae/error";
|
|
3
|
-
|
|
4
|
-
export type ClackReturnWrapper<T> = {
|
|
3
|
+
type ClackIsCancelledWrapper = {
|
|
5
4
|
isCancelled: true;
|
|
6
5
|
message: string;
|
|
7
|
-
}
|
|
6
|
+
};
|
|
7
|
+
type ClackNotCancelledWrapper<T> = {
|
|
8
8
|
isCancelled: false;
|
|
9
9
|
value: T;
|
|
10
10
|
};
|
|
11
|
+
type ClackReturnWrapper<T> = ClackIsCancelledWrapper | ClackNotCancelledWrapper<T>;
|
|
12
|
+
export declare const DEFAULT_CANCEL_MESSAGE = "Operation cancelled.";
|
|
11
13
|
export declare function wrapClackReturn<T>(value: T | typeof CANCEL_SYMBOL, message?: string): ClackReturnWrapper<T>;
|
|
12
14
|
export declare function clackText(opts: TextOptions): Promise<import("@little-nebulae/result").Result<ClackReturnWrapper<string>, UnexpectedError<unknown, null>>>;
|
|
13
15
|
export declare function clackMultiline(opts: MultiLineOptions): Promise<import("@little-nebulae/result").Result<ClackReturnWrapper<string>, UnexpectedError<unknown, null>>>;
|
|
14
16
|
export declare function clackSelect<Value>(opts: SelectOptions<Value>): Promise<import("@little-nebulae/result").Result<ClackReturnWrapper<Awaited<Value>>, UnexpectedError<unknown, null>>>;
|
|
15
17
|
export declare function clackPath(opts: PathOptions): Promise<import("@little-nebulae/result").Result<ClackReturnWrapper<string>, UnexpectedError<unknown, null>>>;
|
|
16
|
-
export declare function clackConfirm(opts: ConfirmOptions): Promise<import("@little-nebulae/result").Result<ClackReturnWrapper<boolean>, UnexpectedError<unknown, null>>>;
|
|
18
|
+
export declare function clackConfirm(opts: ConfirmOptions): Promise<import("@little-nebulae/result").Result<ClackReturnWrapper<boolean>, UnexpectedError<unknown, null>>>;
|
|
19
|
+
export type { ClackIsCancelledWrapper, ClackNotCancelledWrapper, ClackReturnWrapper };
|