-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslotted-element.d.ts
72 lines (62 loc) · 2.1 KB
/
slotted-element.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
export * from "./fetch-element.js";
export class SlottedElement extends FetchElement {
/**
* @see [web component lifecycle](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks)
*/
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
/**
* attribute with id of html element used as template [see light DOM](https://github.com/sashafirsov/css-chain#light-dom-api)
*/
template: string;
/**
* [CssChain](https://github.com/sashafirsov/css-chain) of slotted-elemt children defined by `css`
* @param css
*/
$<T>(css: undefined|string): CssChainCollection<T>&T;
/**
* @see [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
* @param args
*/
fetch( url:Request | string, options ): Promise<any>;
/**
* pre-render callback to massage response data before `render()`
* @param data
*/
setContent(data: any): void;
/**
* read slots from internal DOM. Has to be called before any slots operations.
*/
slotsInit(): void;
/**
* hashmap of slot name to slot used internally
*/
slots: {};
/**
* hide all slots except of named one by setting/removing `hidden` attribute
* @param name
*/
slotOnly(name: string): void;
/**
* remove all slots clones
*/
slotsClear(): void;
/**
* returns node (clone of slot subtree) to be modified before insertion by `slotAdd()`
* @param name
*/
slotClone(name: string): Node;
/**
* adds slot clone node to internal content immediately after original slot
* @param node name or node created by slotClone(name)
*/
slotAdd(node: Node): Node;
/**
* clones slot node and inserts immediately after original slot
* @param nodeName name or node created by slotClone(name)
*/
slotAdd(nodeName: string): Node;
}
export default SlottedElement;
export { $ as CssChain };
import FetchElement from "./fetch-element.js";
import {CssChain as $, CssChainCollection, CssChainT} from "css-chain";