Skip to content

Commit 7f14577

Browse files
committed
add command and commandFor to TS types
1 parent 4ef3857 commit 7f14577

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/types/component-props.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ import type {ComponentChildren} from 'preact';
44
* Shared props for components that accept children.
55
*/
66
export interface BaseProps {
7+
/**
8+
* A command to invoke on `commandFor` target.
9+
* Custom commands begin with `--` and fire a "command" event on the target.
10+
*/
11+
command?: 'show-modal' | 'close' | 'show-popover' | 'hide-popover' | 'toggle-popover' | `--${string}` | null;
12+
13+
/**
14+
* ID of a DOM element or PUI component to invoke `command` on.
15+
*/
16+
commandFor?: string | null;
17+
718
/**
819
* Component contents.
920
*/

0 commit comments

Comments
 (0)