citadel_cli 1.0.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/LICENSE +21 -0
- package/README.md +337 -0
- package/dist/.vite/manifest.json +12 -0
- package/dist/citadel.css +1 -0
- package/dist/citadel.es.js +3039 -0
- package/dist/citadel.umd.js +1015 -0
- package/dist/command_examples/basic-commands.d.ts +83 -0
- package/dist/dist/styles.css +789 -0
- package/dist/index.d.ts +2 -0
- package/dist/src/App.d.ts +4 -0
- package/dist/src/__test-utils__/factories.d.ts +21 -0
- package/dist/src/components/Citadel/Citadel.d.ts +11 -0
- package/dist/src/components/Citadel/Cursor.d.ts +9 -0
- package/dist/src/components/Citadel/__tests__/Citadel.test.d.ts +1 -0
- package/dist/src/components/Citadel/commands/history-commands.d.ts +2 -0
- package/dist/src/components/Citadel/components/AvailableCommands.d.ts +9 -0
- package/dist/src/components/Citadel/components/CommandInput.d.ts +10 -0
- package/dist/src/components/Citadel/components/CommandOutput.d.ts +8 -0
- package/dist/src/components/Citadel/components/CommandOutputLine.d.ts +9 -0
- package/dist/src/components/Citadel/components/Spinner.d.ts +2 -0
- package/dist/src/components/Citadel/components/__tests__/AvailableCommands.test.d.ts +1 -0
- package/dist/src/components/Citadel/components/__tests__/CommandInput.test.d.ts +1 -0
- package/dist/src/components/Citadel/components/__tests__/CommandOutput.test.d.ts +1 -0
- package/dist/src/components/Citadel/components/__tests__/CommandOutputLine.test.d.ts +1 -0
- package/dist/src/components/Citadel/components/__tests__/Spinner.test.d.ts +1 -0
- package/dist/src/components/Citadel/config/CitadelConfigContext.d.ts +11 -0
- package/dist/src/components/Citadel/config/__tests__/CitadelConfigContext.test.d.ts +1 -0
- package/dist/src/components/Citadel/config/defaults.d.ts +26 -0
- package/dist/src/components/Citadel/config/types.d.ts +56 -0
- package/dist/src/components/Citadel/hooks/__tests__/useCitadelState.test.d.ts +1 -0
- package/dist/src/components/Citadel/hooks/__tests__/useCommandHistory.test.d.ts +1 -0
- package/dist/src/components/Citadel/hooks/__tests__/useCommandParser.test.d.ts +1 -0
- package/dist/src/components/Citadel/hooks/__tests__/useCommandTrie.test.d.ts +1 -0
- package/dist/src/components/Citadel/hooks/useCitadelState.d.ts +6 -0
- package/dist/src/components/Citadel/hooks/useCommandHistory.d.ts +17 -0
- package/dist/src/components/Citadel/hooks/useCommandParser.d.ts +19 -0
- package/dist/src/components/Citadel/hooks/useCommandTrie.d.ts +2 -0
- package/dist/src/components/Citadel/hooks/useGlobalShortcut.d.ts +8 -0
- package/dist/src/components/Citadel/hooks/useSlideAnimation.d.ts +14 -0
- package/dist/src/components/Citadel/index.d.ts +2 -0
- package/dist/src/components/Citadel/services/HistoryService.d.ts +15 -0
- package/dist/src/components/Citadel/storage/BaseStorage.d.ts +25 -0
- package/dist/src/components/Citadel/storage/LocalStorage.d.ts +12 -0
- package/dist/src/components/Citadel/storage/MemoryStorage.d.ts +12 -0
- package/dist/src/components/Citadel/storage/StorageFactory.d.ts +9 -0
- package/dist/src/components/Citadel/storage/__tests__/LocalStorage.test.d.ts +1 -0
- package/dist/src/components/Citadel/storage/__tests__/MemoryStorage.test.d.ts +1 -0
- package/dist/src/components/Citadel/types/__tests__/command-trie.test.d.ts +1 -0
- package/dist/src/components/Citadel/types/command-context.d.ts +4 -0
- package/dist/src/components/Citadel/types/command-results.d.ts +41 -0
- package/dist/src/components/Citadel/types/command-trie.d.ts +238 -0
- package/dist/src/components/Citadel/types/cursor.d.ts +26 -0
- package/dist/src/components/Citadel/types/help-command.d.ts +3 -0
- package/dist/src/components/Citadel/types/index.d.ts +3 -0
- package/dist/src/components/Citadel/types/state.d.ts +40 -0
- package/dist/src/components/Citadel/types/storage.d.ts +44 -0
- package/dist/src/components/Citadel/utils/keySimulation.d.ts +2 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/test/setup.d.ts +1 -0
- package/package.json +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CommandNode, CommandTrie, CommandHandler } from '../components/Citadel/types/command-trie';
|
|
2
|
+
import { CitadelState, CitadelActions } from '../components/Citadel/types';
|
|
3
|
+
import { StoredCommand } from '../components/Citadel/types/storage';
|
|
4
|
+
import { CommandHistory, CommandHistoryActions } from '../components/Citadel/hooks/useCommandHistory';
|
|
5
|
+
interface MockNodeOptions {
|
|
6
|
+
argument?: {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
handler?: CommandHandler;
|
|
11
|
+
description?: string;
|
|
12
|
+
isLeaf?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const createMockNode: (name: string, options?: MockNodeOptions) => CommandNode;
|
|
15
|
+
export declare const createMockCommandTrie: () => CommandTrie;
|
|
16
|
+
export declare const createMockStoredCommand: (overrides?: {}) => StoredCommand;
|
|
17
|
+
export declare const createMockCommandHistory: (overrides?: {}) => CommandHistory;
|
|
18
|
+
export declare const createMockCommandHistoryActions: (overrides?: {}) => CommandHistoryActions;
|
|
19
|
+
export declare const createMockCitadelState: (overrides?: {}) => CitadelState;
|
|
20
|
+
export declare const createMockCitadelActions: (overrides?: {}) => CitadelActions;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CitadelConfig } from './config/types';
|
|
2
|
+
export interface CitadelProps {
|
|
3
|
+
config?: CitadelConfig;
|
|
4
|
+
commands?: Record<string, any>;
|
|
5
|
+
containerId?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Citadel: ({ config, commands, containerId }: {
|
|
8
|
+
config?: CitadelConfig | undefined;
|
|
9
|
+
commands?: {} | undefined;
|
|
10
|
+
containerId?: null | undefined;
|
|
11
|
+
}) => null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CursorStyle } from './types/cursor';
|
|
3
|
+
interface CursorProps {
|
|
4
|
+
style?: Partial<CursorStyle> & Pick<CursorStyle, 'type'>;
|
|
5
|
+
isValid?: boolean;
|
|
6
|
+
errorMessage?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Cursor: React.FC<CursorProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CommandNode } from '../types/command-trie';
|
|
3
|
+
import { CitadelState } from '../types/state';
|
|
4
|
+
interface AvailableCommandsProps {
|
|
5
|
+
state: CitadelState;
|
|
6
|
+
availableCommands: CommandNode[];
|
|
7
|
+
}
|
|
8
|
+
export declare const AvailableCommands: React.FC<AvailableCommandsProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CommandNode } from '../types/command-trie';
|
|
3
|
+
import { CitadelState, CitadelActions } from '../types/state';
|
|
4
|
+
interface CommandInputProps {
|
|
5
|
+
state: CitadelState;
|
|
6
|
+
actions: CitadelActions;
|
|
7
|
+
availableCommands: CommandNode[];
|
|
8
|
+
}
|
|
9
|
+
export declare const CommandInput: React.FC<CommandInputProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { OutputItem } from '../types/state';
|
|
3
|
+
interface CommandOutputProps {
|
|
4
|
+
output: OutputItem[];
|
|
5
|
+
outputRef: React.RefObject<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const CommandOutput: React.FC<CommandOutputProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CommandStatus } from '../types/command-results';
|
|
3
|
+
interface CommandOutputLineProps {
|
|
4
|
+
command: string;
|
|
5
|
+
timestamp: string;
|
|
6
|
+
status: CommandStatus;
|
|
7
|
+
}
|
|
8
|
+
export declare const CommandOutputLine: React.FC<CommandOutputLineProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CitadelConfig } from './types';
|
|
3
|
+
import { CommandStorage } from '../types/storage';
|
|
4
|
+
export declare const CitadelConfigProvider: React.FC<{
|
|
5
|
+
config?: CitadelConfig;
|
|
6
|
+
commands?: Record<string, any>;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const useCitadelConfig: () => CitadelConfig;
|
|
10
|
+
export declare const useCitadelCommands: () => Record<string, any> | undefined;
|
|
11
|
+
export declare const useCitadelStorage: () => CommandStorage | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CitadelConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Default configuration for Citadel command interface
|
|
4
|
+
*
|
|
5
|
+
* @property commandTimeoutMs - The time in milliseconds before a command execution fails with a timeout. Default: 10000.
|
|
6
|
+
*
|
|
7
|
+
* @property includeHelpCommand - When true, automatically adds a 'help' command that displays all available commands.
|
|
8
|
+
* When false, no help command is included in the command trie. Default: true.
|
|
9
|
+
*
|
|
10
|
+
* @property maxHeight - The maximum CSS height of the interface. Default: '80vh'.
|
|
11
|
+
*
|
|
12
|
+
* @property outputFontSize - The TailwindCSS class for the font size of the output text. Default: 'text-sm'.
|
|
13
|
+
*
|
|
14
|
+
* @property resetStateOnHide - When true, hiding the interface (via Escape key or other means) will clear the command input.
|
|
15
|
+
* When false, the interface preserves the last input when hidden. Default: false.
|
|
16
|
+
*
|
|
17
|
+
* @property showCitadelKey - The keyboard key that shows the command interface. Default: '.' (period).
|
|
18
|
+
*
|
|
19
|
+
* @property cursorType - The type of cursor animation to display. Can be one of 'blink', 'spin', 'solid', or 'bbs'. Default: 'bbs'.
|
|
20
|
+
*
|
|
21
|
+
* @property cursorColor - The color of the cursor. Default: 'var(--cursor-color, #fff)'.
|
|
22
|
+
*
|
|
23
|
+
* @property cursorSpeed - The speed of cursor animation in milliseconds. Default varies by cursor type:
|
|
24
|
+
* blink: 530ms, spin/bbs: 120ms, solid: N/A
|
|
25
|
+
*/
|
|
26
|
+
export declare const defaultConfig: CitadelConfig;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CursorType } from '../types/cursor';
|
|
2
|
+
import { StorageConfig } from '../types/storage';
|
|
3
|
+
export interface CitadelConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for command history storage
|
|
6
|
+
*/
|
|
7
|
+
storage?: StorageConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to include the default help command in the command trie.
|
|
10
|
+
*/
|
|
11
|
+
includeHelpCommand?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to reset the state when the interface is hidden (via Escape key or other means).
|
|
14
|
+
*/
|
|
15
|
+
resetStateOnHide?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The keyboard key that shows the command interface.
|
|
18
|
+
*/
|
|
19
|
+
showCitadelKey?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The time in milliseconds before a command execution fails with a timeout.
|
|
22
|
+
*/
|
|
23
|
+
commandTimeoutMs?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Optional CSS value for the maximum height of the command interface.
|
|
26
|
+
* If provided, this value will be set as the `max-height` property of the interface.
|
|
27
|
+
*
|
|
28
|
+
* Example:
|
|
29
|
+
* ```
|
|
30
|
+
* <Citadel config={{ maxHeight: '90vh' }} />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
maxHeight?: string;
|
|
34
|
+
minHeight?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The font size for the command output text.
|
|
37
|
+
* Accepts Tailwind text size classes: 'text-xs', 'text-sm', 'text-base', 'text-lg', etc.
|
|
38
|
+
*/
|
|
39
|
+
outputFontSize?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The type of cursor to display. Can be one of 'blink', 'spin', 'solid', or 'bbs'.
|
|
42
|
+
*/
|
|
43
|
+
cursorType?: CursorType;
|
|
44
|
+
/**
|
|
45
|
+
* The color of the cursor.
|
|
46
|
+
* Accepts any valid CSS color value.
|
|
47
|
+
*/
|
|
48
|
+
cursorColor?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The speed of the cursor animation in milliseconds.
|
|
51
|
+
* - For 'blink': Time between blinks (default: 530ms)
|
|
52
|
+
* - For 'spin' and 'bbs': Time between frame changes (default: 120ms)
|
|
53
|
+
* - For 'solid': Has no effect
|
|
54
|
+
*/
|
|
55
|
+
cursorSpeed?: number;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoredCommand } from '../types/storage';
|
|
2
|
+
export interface CommandHistory {
|
|
3
|
+
commands: StoredCommand[];
|
|
4
|
+
position: number | null;
|
|
5
|
+
savedInput: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface CommandHistoryActions {
|
|
8
|
+
addCommand: (command: StoredCommand) => Promise<void>;
|
|
9
|
+
getCommands: () => StoredCommand[];
|
|
10
|
+
navigateHistory: (direction: 'up' | 'down', currentInput: string) => {
|
|
11
|
+
command: StoredCommand | null;
|
|
12
|
+
position: number | null;
|
|
13
|
+
};
|
|
14
|
+
saveInput: (input: string) => void;
|
|
15
|
+
clear: () => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function useCommandHistory(): [CommandHistory, CommandHistoryActions];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CommandNode, CommandTrie } from '../types/command-trie';
|
|
2
|
+
import { CitadelState, CitadelActions } from '../types/state';
|
|
3
|
+
import { StoredCommand } from '../types/storage';
|
|
4
|
+
type InputState = 'idle' | 'entering_command' | 'entering_argument';
|
|
5
|
+
interface UseCommandParserProps {
|
|
6
|
+
commandTrie?: CommandTrie;
|
|
7
|
+
}
|
|
8
|
+
export declare function useCommandParser({ commandTrie: propsTrie }?: UseCommandParserProps): {
|
|
9
|
+
handleInputChange: (newValue: string, state: CitadelState, actions: CitadelActions) => void;
|
|
10
|
+
handleKeyDown: (e: KeyboardEvent, state: CitadelState, actions: CitadelActions) => void;
|
|
11
|
+
executeCommand: (commandStack: string[], actions: CitadelActions, args?: string[]) => void;
|
|
12
|
+
inputState: InputState;
|
|
13
|
+
replayCommand: (command: StoredCommand, state: CitadelState, actions: CitadelActions) => Promise<void>;
|
|
14
|
+
findMatchingCommands: (input: string, availableNodes: CommandNode[]) => CommandNode[];
|
|
15
|
+
getAutocompleteSuggestion: (input: string, availableNodes: CommandNode[]) => string | null;
|
|
16
|
+
getAvailableNodes: (currentNode?: CommandNode) => CommandNode[];
|
|
17
|
+
isValidCommandInput: (input: string, availableNodes: CommandNode[]) => boolean;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface UseGlobalShortcutProps {
|
|
2
|
+
onOpen: () => void;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
isVisible: boolean;
|
|
5
|
+
showCitadelKey: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const useGlobalShortcut: ({ onOpen, onClose, isVisible, showCitadelKey }: UseGlobalShortcutProps) => void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface SlideAnimationOptions {
|
|
2
|
+
isVisible: boolean;
|
|
3
|
+
isClosing: boolean;
|
|
4
|
+
onAnimationComplete?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useSlideAnimation: (options: SlideAnimationOptions) => {
|
|
7
|
+
style: {
|
|
8
|
+
opacity: number;
|
|
9
|
+
transform: string;
|
|
10
|
+
transition: string;
|
|
11
|
+
};
|
|
12
|
+
animationClass: string;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CommandStorage, StoredCommand } from '../types/storage';
|
|
2
|
+
export interface HistoryService {
|
|
3
|
+
getCommands(): Promise<StoredCommand[]>;
|
|
4
|
+
addCommand(command: StoredCommand): Promise<void>;
|
|
5
|
+
clear(): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare class DefaultHistoryService implements HistoryService {
|
|
8
|
+
private readonly storage;
|
|
9
|
+
constructor(storage: CommandStorage);
|
|
10
|
+
getCommands(): Promise<StoredCommand[]>;
|
|
11
|
+
addCommand(command: StoredCommand): Promise<void>;
|
|
12
|
+
clear(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function getHistoryService(storage?: CommandStorage): HistoryService;
|
|
15
|
+
export declare function initializeHistoryService(storage: CommandStorage): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CommandStorage, StorageConfig, StoredCommand } from '../types/storage';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for command history storage implementations
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class BaseStorage implements CommandStorage {
|
|
6
|
+
protected config: Required<StorageConfig>;
|
|
7
|
+
constructor(config?: StorageConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Add a command to history, enforcing storage limits
|
|
10
|
+
*/
|
|
11
|
+
addCommand(command: StoredCommand): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Get all stored commands, ordered by timestamp ascending
|
|
14
|
+
*/
|
|
15
|
+
abstract getCommands(): Promise<StoredCommand[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Clear all stored commands
|
|
18
|
+
*/
|
|
19
|
+
abstract clear(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Save commands to storage
|
|
22
|
+
* @protected
|
|
23
|
+
*/
|
|
24
|
+
protected abstract saveCommands(commands: StoredCommand[]): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StorageConfig, StoredCommand } from '../types/storage';
|
|
2
|
+
import { BaseStorage } from './BaseStorage';
|
|
3
|
+
/**
|
|
4
|
+
* localStorage-based command history storage
|
|
5
|
+
*/
|
|
6
|
+
export declare class LocalStorage extends BaseStorage {
|
|
7
|
+
private readonly storageKey;
|
|
8
|
+
constructor(config: StorageConfig);
|
|
9
|
+
getCommands(): Promise<StoredCommand[]>;
|
|
10
|
+
clear(): Promise<void>;
|
|
11
|
+
protected saveCommands(commands: StoredCommand[]): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StorageConfig, StoredCommand } from '../types/storage';
|
|
2
|
+
import { BaseStorage } from './BaseStorage';
|
|
3
|
+
/**
|
|
4
|
+
* In-memory command history storage
|
|
5
|
+
*/
|
|
6
|
+
export declare class MemoryStorage extends BaseStorage {
|
|
7
|
+
private commands;
|
|
8
|
+
constructor(config?: StorageConfig);
|
|
9
|
+
getCommands(): Promise<StoredCommand[]>;
|
|
10
|
+
clear(): Promise<void>;
|
|
11
|
+
protected saveCommands(commands: StoredCommand[]): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CommandStorage, StorageConfig } from '../types/storage';
|
|
2
|
+
export declare class StorageFactory {
|
|
3
|
+
private static instance;
|
|
4
|
+
private currentStorage?;
|
|
5
|
+
private constructor();
|
|
6
|
+
static getInstance(): StorageFactory;
|
|
7
|
+
initializeStorage(config: StorageConfig): void;
|
|
8
|
+
getStorage(): CommandStorage;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare enum CommandStatus {
|
|
3
|
+
Pending = "pending",
|
|
4
|
+
Success = "success",
|
|
5
|
+
Failure = "failure",
|
|
6
|
+
Timeout = "timeout"
|
|
7
|
+
}
|
|
8
|
+
export declare abstract class CommandResult {
|
|
9
|
+
readonly timestamp: number;
|
|
10
|
+
private _status;
|
|
11
|
+
constructor(timestamp?: number);
|
|
12
|
+
get status(): CommandStatus;
|
|
13
|
+
markSuccess(): void;
|
|
14
|
+
markFailure(): void;
|
|
15
|
+
markTimeout(): void;
|
|
16
|
+
abstract render(): React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare class JsonCommandResult extends CommandResult {
|
|
19
|
+
readonly data: any;
|
|
20
|
+
constructor(data: any, timestamp?: number);
|
|
21
|
+
render(): React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare class TextCommandResult extends CommandResult {
|
|
24
|
+
readonly text: string;
|
|
25
|
+
constructor(text: string, timestamp?: number);
|
|
26
|
+
render(): React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export declare class ErrorCommandResult extends CommandResult {
|
|
29
|
+
readonly error: string;
|
|
30
|
+
constructor(error: string, timestamp?: number);
|
|
31
|
+
render(): React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare class PendingCommandResult extends CommandResult {
|
|
34
|
+
render(): React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export declare class ImageCommandResult extends CommandResult {
|
|
37
|
+
readonly imageUrl: string;
|
|
38
|
+
readonly altText: string;
|
|
39
|
+
constructor(imageUrl: string, altText?: string, timestamp?: number);
|
|
40
|
+
render(): React.ReactNode;
|
|
41
|
+
}
|