mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
@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:
committed by
Pranav Senthilnathan
parent
929dcd4579
commit
fc8b7956f9
Vendored
+5
-4
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user