-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.d.ts
112 lines (98 loc) · 2.62 KB
/
index.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import type {Properties} from 'hastscript'
export {default} from './lib/index.js'
/**
* Fields supported by `rehype-document`.
*/
interface DocumentFields {
/**
* Title of the document
* (optional,
* example: `'The New York City Subway Map as You’ve Never Seen It Before'`).
*
* Inferred by `rehype-infer-title-meta` from HTML or `vfile-matter` from
* frontmatter.
* Used by `rehype-document` and `rehype-meta`.
*/
title?: string | null | undefined
}
/**
* Configuration.
*/
export interface Options {
/**
* URLs to stylesheets to use in `<link>`s (optional).
*/
css?: ReadonlyArray<string> | string | null | undefined
// To do: next major: rename to `direction`?
/**
* Direction of the document (optional).
*/
dir?: 'auto' | 'ltr' | 'rtl' | null | undefined
/**
* URLs to scripts to use as `src` on `<script>`s (optional).
*/
js?: ReadonlyArray<string> | string | null | undefined
/**
* Language of document
* (default: `'en'`);
* should be a [BCP 47](https://tools.ietf.org/html/bcp47) language tag.
*/
language?: string | null | undefined
/**
* Generate extra `<link>`s with these properties
* (optional);
* passed as `properties` to
* [`hastscript`](https://github.com/syntax-tree/hastscript) with `'link'`.
*/
link?:
| ReadonlyArray<Readonly<Properties>>
| Readonly<Properties>
| null
| undefined
/**
* Generate extra `<meta>`s with these properties
* (optional);
* passed as `properties` to
* [`hastscript`](https://github.com/syntax-tree/hastscript) with `'meta'`.
*/
meta?:
| ReadonlyArray<Readonly<Properties>>
| Readonly<Properties>
| null
| undefined
/**
* Generate a `meta[viewport]`
* (default: `true`).
*/
responsive?: boolean | null | undefined
/**
* JavaScript source code of `<script>`s to add at end of `body`
* (optional).
*/
script?: ReadonlyArray<string> | string | null | undefined
/**
* CSS source code of `<style>`s to add
* (optional).
*/
style?: ReadonlyArray<string> | string | null | undefined
/**
* Text to use as title
* (optional);
* defaults to the file name (if any);
* can bet set with `file.data.matter.title`
* (`vfile-matter`)
* and `file.data.meta.title`
* (`rehype-infer-title-meta`),
* which are preferred.
*/
title?: string | null | undefined
}
// Add custom data supported when `rehype-document` is added.
declare module 'vfile' {
interface DataMapMatter extends DocumentFields {}
interface DataMapMeta extends DocumentFields {}
interface DataMap {
matter: DataMapMatter
meta: DataMapMeta
}
}