@@ -5,13 +5,18 @@ type Component = ComponentOptions<Vue> | typeof Vue
5
5
type CallbackFn = ( ) => void
6
6
type elements = HTMLElement [ ]
7
7
8
- export interface VueMetaOptions {
8
+ export interface VueMetaOptionsRuntime {
9
+ refreshOnceOnNavigation ?: boolean
10
+ debounceWait ?: number
11
+ waitOnDestroyed ?: boolean
12
+ }
13
+
14
+ export interface VueMetaOptions extends VueMetaOptionsRuntime {
9
15
keyName : string , // the component option name that vue-meta looks for meta info on.
10
16
attribute : string , // the attribute name vue-meta adds to the tags it observes
11
17
ssrAppId : string , // the app id used for ssr app
12
18
ssrAttribute : string , // the attribute name that lets vue-meta know that meta info has already been server-rendered
13
19
tagIDKeyName : string // the property name that vue-meta uses to determine whether to overwrite or append a tag
14
- refreshOnceOnNavigation : boolean
15
20
}
16
21
17
22
export declare class VueMeta {
@@ -21,17 +26,26 @@ export declare class VueMeta {
21
26
static generate ( metaInfo : MetaInfo , options ?: Object ) : MetaInfoSSR
22
27
}
23
28
29
+ interface RefreshedTags {
30
+ addedTags : elements
31
+ removedTags : elements
32
+ }
33
+
24
34
interface Refreshed {
25
35
vm : Component ,
26
36
metaInfo : MetaInfo ,
27
- tags : {
28
- addedTags : elements
29
- removedTags : elements
30
- }
37
+ tags : RefreshedTags
38
+ }
39
+
40
+ interface VueMetaApp {
41
+ set ( metaInfo : MetaInfo ) : void | RefreshedTags
42
+ remove ( ) : void
31
43
}
32
44
33
45
export interface VueMetaPlugin {
34
46
getOptions ( ) : VueMetaOptions
47
+ setOptions ( runtimeOptions : VueMetaOptionsRuntime ) : VueMetaOptions
48
+ addApp ( appName : string ) : VueMetaApp
35
49
refresh ( ) : Refreshed
36
50
inject ( ) : MetaInfoSSR
37
51
pause ( refresh : true ) : ( ) => Refreshed
@@ -188,6 +202,10 @@ interface ToTextBooleanArg {
188
202
text ( addSrrAttribute ?: boolean ) : string
189
203
}
190
204
205
+ interface AddLineBreakOption {
206
+ ln : boolean
207
+ }
208
+
191
209
interface ToBodyTextOption {
192
210
body : boolean
193
211
}
@@ -197,18 +215,21 @@ interface ToPbodyTextOption {
197
215
}
198
216
199
217
interface ToBodyText {
200
- text ( options ?: ( ToBodyTextOption | ToPbodyTextOption ) ) : string
218
+ text ( options ?: ( ToBodyTextOption | ToPbodyTextOption | AddLineBreakOption ) ) : string
201
219
}
202
220
203
221
export interface MetaInfoSSR {
222
+ head ( ln ?: boolean ) : string
223
+ bodyPrepend ( ln ?: boolean ) : string
224
+ bodyAppend ( ln ?: boolean ) : string
204
225
title ?: ToText
205
226
htmlAttrs ?: ToTextBooleanArg
206
227
headAttrs ?: ToText
207
228
bodyAttrs ?: ToText
208
- base ?: ToText
209
- meta ?: ToText
210
- link ?: ToText
211
- style ?: ToText
229
+ base ?: ToBodyText
230
+ meta ?: ToBodyText
231
+ link ?: ToBodyText
232
+ style ?: ToBodyText
212
233
script ?: ToBodyText
213
234
noscript ?: ToBodyText
214
235
}
0 commit comments