-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathPlugin.d.ts
More file actions
36 lines (30 loc) · 855 Bytes
/
Plugin.d.ts
File metadata and controls
36 lines (30 loc) · 855 Bytes
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
import { NullstackClientContext } from './ClientContext'
import { AllHTMLAttributes, NullstackAttributes } from './JSX'
interface NullstackPluginNode {
type: string | boolean
attributes: AllHTMLAttributes<HTMLElement> & NullstackAttributes
children: NullstackClientContext['children']
}
interface NullstackNodeContext extends NullstackClientContext {
node: NullstackPluginNode
}
export interface NullstackPlugin {
/**
* Runs transformation to node element
* @param context Context with node attributes
*/
transform(context: NullstackNodeContext)
/**
* Load something when plugin installs
* @param context Application context
*/
load?(context: NullstackClientContext)
/**
* Use plugin in the server environment
*/
server?: boolean
/**
* Use plugin in the client environment
*/
client?: boolean
}