mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-25 15:30:33 +03:00
Attempt on typings.
This commit is contained in:
Generated
+3
-3
@@ -7574,9 +7574,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mocha": {
|
"mocha": {
|
||||||
"version": "4.1.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.0.tgz",
|
||||||
"integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==",
|
"integrity": "sha512-ukB2dF+u4aeJjc6IGtPNnJXfeby5d4ZqySlIBT0OEyva/DrMjVm5HkQxKnHDLKEfEQBsEnwTg9HHhtPHJdTd8w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"browser-stdout": "1.3.0",
|
"browser-stdout": "1.3.0",
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "lib/vue-meta.js",
|
"main": "lib/vue-meta.js",
|
||||||
|
"typings": "types/index.d.ts",
|
||||||
"nyc": {
|
"nyc": {
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"test/**/*.js"
|
"test/**/*.js"
|
||||||
|
|||||||
Vendored
+62
@@ -0,0 +1,62 @@
|
|||||||
|
import Vue, { ComponentOptions } from 'vue'
|
||||||
|
import { PluginFunction } from 'vue/types/plugin';
|
||||||
|
|
||||||
|
import './vue';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Installation function
|
||||||
|
*
|
||||||
|
* @param {Vue} Vue - the Vue constructor.
|
||||||
|
* @param {{
|
||||||
|
* keyName: string, // the component option name that vue-meta looks for meta info on.
|
||||||
|
* attribute: string, // the attribute name vue-meta adds to the tags it observes
|
||||||
|
* ssrAttribute: string, // the attribute name that lets vue-meta know that meta info has already been server-rendered
|
||||||
|
* tagIDKeyName: string // the property name that vue-meta uses to determine whether to overwrite or append a tag
|
||||||
|
* }} options
|
||||||
|
*/
|
||||||
|
declare const Meta: PluginFunction<{
|
||||||
|
keyName: string, // the component option name that vue-meta looks for meta info on.
|
||||||
|
attribute: string, // the attribute name vue-meta adds to the tags it observes
|
||||||
|
ssrAttribute: string, // the attribute name that lets vue-meta know that meta info has already been server-rendered
|
||||||
|
tagIDKeyName: string // the property name that vue-meta uses to determine whether to overwrite or append a tag
|
||||||
|
}>;
|
||||||
|
|
||||||
|
export default Meta;
|
||||||
|
|
||||||
|
export interface MetaInfo {
|
||||||
|
title?: string
|
||||||
|
titleTemplate?: string | ((titleChunk: string) => string)
|
||||||
|
htmlAttrs?: { [key: string]: string }
|
||||||
|
bodyAttrs?: { [key: string]: string }
|
||||||
|
base?: { target: string, href: string }
|
||||||
|
|
||||||
|
meta?: {
|
||||||
|
vmid?: string,
|
||||||
|
charset?: string,
|
||||||
|
content?: string,
|
||||||
|
'http-equiv'?: 'content-security-policy' | 'refresh',
|
||||||
|
name?: 'application-name'
|
||||||
|
| 'author'
|
||||||
|
| 'description'
|
||||||
|
| 'generator'
|
||||||
|
| 'keywords'
|
||||||
|
| 'referrer'
|
||||||
|
| 'creator'
|
||||||
|
| 'googlebot'
|
||||||
|
| 'publisher'
|
||||||
|
| 'robots'
|
||||||
|
| 'slurp'
|
||||||
|
| 'viewport',
|
||||||
|
[key: string]: any
|
||||||
|
}[]
|
||||||
|
|
||||||
|
link?: { rel: string, href: string, [key: string]: any }[]
|
||||||
|
style?: { cssText: string, type: string, [key: string]: any }[]
|
||||||
|
script?: { innerHTML: string, type: string, [key: string]: any }[]
|
||||||
|
noscript?: { innerHTML: string, [key: string]: any }[]
|
||||||
|
|
||||||
|
__dangerouslyDisableSanitizers?: string[]
|
||||||
|
__dangerouslyDisableSanitizersByTagID?: string[]
|
||||||
|
|
||||||
|
changed?: <T extends object>(newInfo: T, addedTags: HTMLElement[], removedTags: HTMLElement[]) => void
|
||||||
|
}
|
||||||
Vendored
+18
@@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Augment the typings of Vue.js
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Vue, { ComponentOptions } from "vue";
|
||||||
|
import { MetaInfo } from './index';
|
||||||
|
|
||||||
|
declare module "vue/types/options" {
|
||||||
|
interface ComponentOptions<V extends Vue> {
|
||||||
|
metaInfo?: MetaInfo | (() => MetaInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "vue/types/vue" {
|
||||||
|
interface Vue {
|
||||||
|
metaInfo?: MetaInfo | (() => MetaInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user