mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
feat(context-menu): annotate props, generate types
This commit is contained in:
parent
3a1e561a27
commit
2ff4d43292
11 changed files with 582 additions and 19 deletions
40
types/ContextMenu/ContextMenu.d.ts
vendored
Normal file
40
types/ContextMenu/ContextMenu.d.ts
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface ContextMenuProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["ul"]> {
|
||||
/**
|
||||
* Set to `true` to open the menu
|
||||
* Either `x` and `y` must be greater than zero
|
||||
* @default false
|
||||
*/
|
||||
open?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the horizontal offset of the menu position
|
||||
* @default 0
|
||||
*/
|
||||
x?: number;
|
||||
|
||||
/**
|
||||
* Specify the vertical offset of the menu position
|
||||
* @default 0
|
||||
*/
|
||||
y?: number;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the unordered list HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLUListElement;
|
||||
}
|
||||
|
||||
export default class ContextMenu extends SvelteComponentTyped<
|
||||
ContextMenuProps,
|
||||
{
|
||||
click: WindowEventMap["click"];
|
||||
keydown: WindowEventMap["keydown"];
|
||||
close: CustomEvent<any>;
|
||||
},
|
||||
{ default: {} }
|
||||
> {}
|
Loading…
Add table
Add a link
Reference in a new issue