@types/webidl2
Advanced tools
Comparing version 23.8.0 to 23.11.0
@@ -1,4 +0,5 @@ | ||
// Type definitions for webidl2 23.8 | ||
// Type definitions for webidl2 23.11 | ||
// Project: https://github.com/w3c/webidl2.js#readme | ||
// Definitions by: Kagama Sascha Rosylight <https://github.com/saschanaz> | ||
// ExE Boss <https://github.com/ExE-Boss> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -10,8 +11,23 @@ | ||
export type IDLRootType = InterfaceType | InterfaceMixinType | NamespaceType | CallbackType | DictionaryType | EnumType | TypedefType | IncludesType; | ||
export type IDLRootType = | ||
| InterfaceType | ||
| InterfaceMixinType | ||
| NamespaceType | ||
| CallbackType | ||
| DictionaryType | ||
| EnumType | ||
| TypedefType | ||
| IncludesType; | ||
export type IDLInterfaceMemberType = OperationMemberType | ConstructorMemberType | AttributeMemberType | ConstantMemberType | DeclarationMemberType; | ||
export type IDLInterfaceMemberType = | ||
| OperationMemberType | ||
| ConstructorMemberType | ||
| AttributeMemberType | ||
| ConstantMemberType | ||
| DeclarationMemberType; | ||
export type IDLNamespaceMemberType = OperationMemberType | AttributeMemberType; | ||
export type IDLTypeDescription = SingleTypeDescription | UnionTypeDescription; | ||
export interface ParseOptions { | ||
@@ -24,7 +40,24 @@ /** Boolean indicating whether the result should include EOF node or not. */ | ||
export interface WebIDLParseError { | ||
export class WebIDLParseError extends Error { | ||
constructor(options: { | ||
message: string; | ||
bareMessage: string; | ||
context: string; | ||
line: number; | ||
sourceName?: string; | ||
input: string; | ||
tokens: ValueDescription[]; | ||
}); | ||
name: "WebIDLParseError"; | ||
/** the error message */ | ||
message: string; | ||
bareMessage: string; | ||
context: string; | ||
/** the line at which the error occurred. */ | ||
line: number; | ||
sourceName: string | undefined; | ||
/** a short peek at the text at the point where the error happened */ | ||
@@ -34,8 +67,25 @@ input: string; | ||
tokens: ValueDescription[]; | ||
} | ||
toString(): string; | ||
export interface SingleTypeDescription { | ||
/** String indicating where this type is used. Can be null if not applicable. */ | ||
type: string | null; | ||
/** Boolean indicating if it is a sequence. Same as generic === "sequence" */ | ||
sequence: boolean; | ||
/** String indicating the generic type (e.g. "Promise", "sequence"). null otherwise. */ | ||
generic: string | null; | ||
/** Boolean indicating whether this is nullable or not. */ | ||
nullable: boolean; | ||
/** Boolean indicating whether this is a union type or not. */ | ||
union: false; | ||
/** | ||
* In most cases, this will just be a string with the type name. | ||
* If the type is a union, then this contains an array of the types it unites. | ||
* If it is a generic type, it contains the IDL type description for the type in the sequence, | ||
* the eventual value of the promise, etc. | ||
*/ | ||
idlType: string; | ||
} | ||
// tslint:disable-next-line interface-name | ||
export interface IDLTypeDescription { | ||
export interface UnionTypeDescription { | ||
/** String indicating where this type is used. Can be null if not applicable. */ | ||
@@ -50,3 +100,3 @@ type: string | null; | ||
/** Boolean indicating whether this is a union type or not. */ | ||
union: boolean; | ||
union: true; | ||
/** | ||
@@ -58,3 +108,3 @@ * In most cases, this will just be a string with the type name. | ||
*/ | ||
idlType: string | IDLTypeDescription[]; | ||
idlType: IDLTypeDescription[]; | ||
} | ||
@@ -126,8 +176,3 @@ | ||
export interface DictionaryMemberType extends FieldType { | ||
/** Boolean indicating whether this is a required field. */ | ||
required: boolean; | ||
/** A default value, absent if there is none. */ | ||
default: ValueDescription | null; | ||
} | ||
export type DictionaryMemberType = FieldType; | ||
@@ -138,2 +183,4 @@ export interface FieldType { | ||
name: string; | ||
/** Boolean indicating whether this is a required field. */ | ||
required: boolean; | ||
/** An IDL Type describing what field's type. */ | ||
@@ -152,3 +199,3 @@ idlType: IDLTypeDescription; | ||
/** An array of values (strings). */ | ||
values: Array<{ type: "string", value: string }>; | ||
values: Array<{ type: "string"; value: string }>; | ||
/** A list of extended attributes. */ | ||
@@ -184,2 +231,4 @@ extAttrs: ExtendedAttribute[]; | ||
extAttrs: ExtendedAttribute[]; | ||
/** The container of this type. */ | ||
parent: InterfaceType; | ||
} | ||
@@ -199,2 +248,4 @@ | ||
extAttrs: ExtendedAttribute[]; | ||
/** The container of this type. */ | ||
parent: InterfaceType | InterfaceMixinType | NamespaceType; | ||
} | ||
@@ -216,2 +267,4 @@ | ||
extAttrs: ExtendedAttribute[]; | ||
/** The container of this type. */ | ||
parent: InterfaceType | InterfaceMixinType | NamespaceType; | ||
} | ||
@@ -231,2 +284,4 @@ | ||
extAttrs: ExtendedAttribute[]; | ||
/** The container of this type. */ | ||
parent: InterfaceType | InterfaceMixinType; | ||
} | ||
@@ -246,2 +301,4 @@ | ||
extAttrs: ExtendedAttribute[]; | ||
/** The container of this type. */ | ||
parent: CallbackType | ConstructorMemberType | ExtendedAttribute | OperationMemberType; | ||
} | ||
@@ -254,10 +311,17 @@ | ||
arguments: Argument[]; | ||
/** If there is a right-hand side, this will capture its type ("identifier" or "identifier-list") and its value. */ | ||
rhs: ExtendedAttributeRightHandSideIdentifier | ExtendedAttributeRightHandSideIdentifierList | null; | ||
/** If there is a right-hand side, this will capture its type and value. */ | ||
rhs: ExtendedAttributeRightHandSide | null; | ||
/** The container of this extended attribute. */ | ||
parent: IDLRootType | FieldType | IDLInterfaceMemberType; | ||
} | ||
export interface Token { | ||
type: "float" | "integer" | "identifier" | "string" | "whitespace" | "other"; | ||
value: string; | ||
} | ||
export type ExtendedAttributeRightHandSide = | ||
| ExtendedAttributeRightHandSideIdentifier | ||
| ExtendedAttributeRightHandSideIdentifierList | ||
| ExtendedAttributeRightHandSideString | ||
| ExtendedAttributeRightHandSideStringList | ||
| ExtendedAttributeRightHandSideDecimal | ||
| ExtendedAttributeRightHandSideDecimalList | ||
| ExtendedAttributeRightHandSideInteger | ||
| ExtendedAttributeRightHandSideIntegerList; | ||
@@ -274,2 +338,37 @@ export interface ExtendedAttributeRightHandSideIdentifier { | ||
export interface ExtendedAttributeRightHandSideString { | ||
type: "string"; | ||
value: string; | ||
} | ||
export interface ExtendedAttributeRightHandSideStringList { | ||
type: "string-list"; | ||
value: ExtendedAttributeRightHandSideString[]; | ||
} | ||
export interface ExtendedAttributeRightHandSideDecimal { | ||
type: "decimal"; | ||
value: string; | ||
} | ||
export interface ExtendedAttributeRightHandSideDecimalList { | ||
type: "decimal-list"; | ||
value: ExtendedAttributeRightHandSideDecimal[]; | ||
} | ||
export interface ExtendedAttributeRightHandSideInteger { | ||
type: "integer"; | ||
value: string; | ||
} | ||
export interface ExtendedAttributeRightHandSideIntegerList { | ||
type: "integer-list"; | ||
value: ExtendedAttributeRightHandSideInteger[]; | ||
} | ||
export interface Token { | ||
type: "decimal" | "integer" | "identifier" | "string" | "whitespace" | "other"; | ||
value: string; | ||
} | ||
export interface ValueDescription { | ||
@@ -276,0 +375,0 @@ type: "string" | "number" | "boolean" | "null" | "Infinity" | "NaN" | "sequence" | "dictionary"; |
{ | ||
"name": "@types/webidl2", | ||
"version": "23.8.0", | ||
"version": "23.11.0", | ||
"description": "TypeScript definitions for webidl2", | ||
@@ -11,6 +11,11 @@ "license": "MIT", | ||
"githubUsername": "saschanaz" | ||
}, | ||
{ | ||
"name": "ExE Boss", | ||
"url": "https://github.com/ExE-Boss", | ||
"githubUsername": "ExE-Boss" | ||
} | ||
], | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -23,4 +28,4 @@ "type": "git", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "fbade5bbd72a919a0ba0bd25e81c33da51f504b070cc64516369c9dca72fa848", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "e95fc5ea3183ecb074c48e7d921ee9aa2aae3ffc49185ba709a528c6fdf80b99", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl2 | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl2. | ||
Additional Details | ||
* Last updated: Wed, 11 Sep 2019 05:46:32 GMT | ||
### Additional Details | ||
* Last updated: Thu, 02 Apr 2020 17:20:41 GMT | ||
* Dependencies: none | ||
* Global values: WebIDL2 | ||
* Global values: `WebIDL2` | ||
# Credits | ||
These definitions were written by Kagama Sascha Rosylight <https://github.com/saschanaz>. | ||
These definitions were written by [Kagama Sascha Rosylight](https://github.com/saschanaz), and [ExE Boss](https://github.com/ExE-Boss). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15072
331