@types/unist: update to v2.0.0 (#30522)

* update unist typing to v2.0.0

* remove v1, use npm version instead
This commit is contained in:
Lu, Jun
2018-11-18 10:57:31 -08:00
committed by Pranav Senthilnathan
parent 929dcd4579
commit fc8b7956f9
3 changed files with 17 additions and 28 deletions
+5 -4
View File
@@ -1,6 +1,7 @@
// Type definitions for Unist 1.0
// Type definitions for Unist 2.0
// Project: https://github.com/syntax-tree/unist
// Definitions by: bizen241 <https://github.com/bizen241>
// Jun Lu <https://github.com/lujun2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
@@ -11,7 +12,7 @@ export interface Node {
}
export interface Data {
[key: string]: string | number | object | any[] | boolean | null;
[key: string]: any;
}
export interface Position {
@@ -34,6 +35,6 @@ export interface Parent extends Node {
children: Node[];
}
export interface Text extends Node {
value: string;
export interface Literal extends Node {
value: any;
}
+4 -11
View File
@@ -1,23 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"unist-tests.ts"
]
}
"files": ["index.d.ts", "unist-tests.ts"]
}
+8 -13
View File
@@ -4,46 +4,41 @@ const data: Unist.Data = {
string: 'string',
number: 1,
object: {
key: 'value',
key: 'value'
},
array: [],
boolean: true,
null: null,
null: null
};
const point: Unist.Point = {
line: 1,
column: 1,
offset: 0,
offset: 0
};
const position: Unist.Position = {
start: point,
end: point,
indent: [
1,
],
indent: [1]
};
const node: Unist.Node = {
type: 'node',
data,
position,
position
};
const text: Unist.Text = {
const text: Unist.Literal = {
type: 'text',
data,
position,
value: 'value',
value: 'value'
};
const parent: Unist.Parent = {
type: 'parent',
data,
position,
children: [
node,
text,
],
children: [node, text]
};