Skip to content

Commit

Permalink
feat(typings): add key and ref to slot elements (#3177)
Browse files Browse the repository at this point in the history
this pr adds the `key` and `ref` fields as optional onto the `slot`
element's typings. it also performs some minor refactoring to make
better reuse of typings.
  • Loading branch information
kraftwer1 committed Dec 15, 2021
1 parent c24916e commit ce27a18
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/declarations/stencil-public-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ export namespace JSXBase {
view: JSXBase.SVGAttributes;
}

export interface SlotAttributes {
export interface SlotAttributes extends JSXAttributes {
name?: string;
slot?: string;
onSlotchange?: (event: Event) => void;
Expand Down Expand Up @@ -1579,11 +1579,7 @@ export namespace JSXBase {
zoomAndPan?: string;
}

export interface DOMAttributes<T = Element> {
// vdom specific
key?: string | number;

ref?: (elm?: T) => void;
export interface DOMAttributes<T> extends JSXAttributes<T> {
slot?: string;
part?: string;
exportparts?: string;
Expand Down Expand Up @@ -1731,6 +1727,12 @@ export namespace JSXBase {
}
}

export interface JSXAttributes<T = Element> {
// vdom specific
key?: string | number;
ref?: (elm?: T) => void;
}

export interface CustomElementsDefineOptions {
exclude?: string[];
resourcesUrl?: string;
Expand Down

0 comments on commit ce27a18

Please sign in to comment.