Skip to content

Commit caa32e8

Browse files
authored
feat: export CANCEL_SYMBOL (#592)
1 parent 8d81248 commit caa32e8

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎.changeset/export-cancel-symbol.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@clack/core": minor
3+
"@clack/prompts": minor
4+
---
5+
6+
Export `CANCEL_SYMBOL` constant from `@clack/core` and `@clack/prompts`

‎packages/core/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export { default as SelectKeyPrompt } from './prompts/select-key.js';
2121
export type { TextOptions } from './prompts/text.js';
2222
export { default as TextPrompt } from './prompts/text.js';
2323
export type { ClackState as State } from './types.js';
24-
export { block, getColumns, getRows, isCancel, wrapTextWithPrefix } from './utils/index.js';
24+
export { CANCEL_SYMBOL, block, getColumns, getRows, isCancel, wrapTextWithPrefix } from './utils/index.js';
2525
export type { ClackSettings } from './utils/settings.js';
2626
export { settings, updateSettings } from './utils/settings.js';
2727
export type { Validate } from './utils/validation.js';

‎packages/core/src/utils/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const isWindows = globalThis.process.platform.startsWith('win');
1414

1515
export const CANCEL_SYMBOL = Symbol('clack:cancel');
1616

17-
export function isCancel(value: unknown): value is symbol {
17+
export function isCancel(value: unknown): value is typeof CANCEL_SYMBOL {
1818
return value === CANCEL_SYMBOL;
1919
}
2020

‎packages/prompts/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type { ClackSettings } from '@clack/core';
2-
export { isCancel, settings, updateSettings } from '@clack/core';
2+
export { CANCEL_SYMBOL, isCancel, settings, updateSettings } from '@clack/core';
33

44
export * from './autocomplete.js';
55
export * from './box.js';

0 commit comments

Comments
 (0)