Skip to content

Commit 545277e

Browse files
committed
refactor: trim projection exports
1 parent 6845db9 commit 545277e

2 files changed

Lines changed: 6 additions & 18 deletions

File tree

src/commands/cli-grammar.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
11
export { readInputFromCli } from './cli-grammar/registry.ts';
2-
export {
3-
prepareBatchStep,
4-
prepareDaemonCommandRequest,
5-
batchCommandNames,
6-
type BatchCommandName,
7-
type DaemonCommandName,
8-
} from './command-projection.ts';

src/commands/command-projection.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,20 @@ const daemonWriters = {
3131
} satisfies Record<string, DaemonWriter>;
3232

3333
export type DaemonCommandName = keyof typeof daemonWriters;
34-
type NonBatchCommandName =
35-
| 'replay'
36-
| 'batch'
37-
| 'gesture-pan'
38-
| 'gesture-fling'
39-
| 'gesture-pinch'
40-
| 'gesture-rotate'
41-
| 'gesture-transform';
42-
export type BatchCommandName = Exclude<DaemonCommandName, NonBatchCommandName>;
4334

44-
const nonBatchCommandNames = commandNameSet([
35+
const NON_BATCH_COMMAND_NAMES = [
4536
'replay',
4637
'batch',
4738
'gesture-pan',
4839
'gesture-fling',
4940
'gesture-pinch',
5041
'gesture-rotate',
5142
'gesture-transform',
52-
] as const satisfies readonly NonBatchCommandName[]);
43+
] as const;
44+
type NonBatchCommandName = (typeof NON_BATCH_COMMAND_NAMES)[number];
45+
export type BatchCommandName = Exclude<DaemonCommandName, NonBatchCommandName>;
46+
47+
const nonBatchCommandNames = commandNameSet(NON_BATCH_COMMAND_NAMES);
5348

5449
export const batchCommandNames = (Object.keys(daemonWriters) as DaemonCommandName[]).filter(
5550
(name): name is BatchCommandName => !nonBatchCommandNames.has(name),

0 commit comments

Comments
 (0)