New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dts-dom

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dts-dom - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

38

bin/index.d.ts

@@ -36,3 +36,5 @@ export interface DeclarationBase {

name: string;
members: Array<ClassMember>;
members: ClassMember[];
implements: InterfaceDeclaration[];
baseType?: ObjectTypeReference;
}

@@ -43,3 +45,3 @@ export interface InterfaceDeclaration extends DeclarationBase {

members: ObjectTypeMember[];
baseTypes?: TypeReference[];
baseTypes?: ObjectTypeReference[];
}

@@ -60,6 +62,2 @@ export interface NamespaceDeclaration extends DeclarationBase {

}
export interface NamespaceDeclaration extends DeclarationBase {
kind: "namespace";
members: NamespaceMember[];
}
export interface ObjectType {

@@ -92,2 +90,3 @@ kind: "object";

export declare type TypeReference = TopLevelDeclaration | NamedTypeReference | ArrayTypeReference | PrimitiveType;
export declare type ObjectTypeReference = ClassDeclaration | InterfaceDeclaration;
export declare type ObjectTypeMember = PropertyDeclaration | MethodDeclaration;

@@ -105,2 +104,3 @@ export declare type ClassMember = ObjectTypeMember | ConstructorDeclaration;

Export = 16,
Abstract = 32,
}

@@ -115,11 +115,11 @@ export declare enum ParameterFlags {

class(name: string): ClassDeclaration;
property(name: string, type: Type, flags?: DeclarationFlags): PropertyDeclaration;
method(name: string, parameters: Parameter[], returnType: Type, flags?: DeclarationFlags): MethodDeclaration;
function(name: string, parameters: Parameter[], returnType: Type): FunctionDeclaration;
parameter(name: string, type: Type, flags?: ParameterFlags): Parameter;
property(name: string, type: InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | ExportEqualsDeclaration | NamedTypeReference | ArrayTypeReference | "string" | "number" | "boolean" | "any" | "void" | UnionType | IntersectionType | ObjectType, flags?: DeclarationFlags): PropertyDeclaration;
method(name: string, parameters: Parameter[], returnType: InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | ExportEqualsDeclaration | NamedTypeReference | ArrayTypeReference | "string" | "number" | "boolean" | "any" | "void" | UnionType | IntersectionType | ObjectType, flags?: DeclarationFlags): MethodDeclaration;
function(name: string, parameters: Parameter[], returnType: InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | ExportEqualsDeclaration | NamedTypeReference | ArrayTypeReference | "string" | "number" | "boolean" | "any" | "void" | UnionType | IntersectionType | ObjectType): FunctionDeclaration;
parameter(name: string, type: InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | ExportEqualsDeclaration | NamedTypeReference | ArrayTypeReference | "string" | "number" | "boolean" | "any" | "void" | UnionType | IntersectionType | ObjectType, flags?: ParameterFlags): Parameter;
constructor(parameters: Parameter[], flags?: DeclarationFlags): ConstructorDeclaration;
const(name: string, type: Type): ConstDeclaration;
const(name: string, type: InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | ExportEqualsDeclaration | NamedTypeReference | ArrayTypeReference | "string" | "number" | "boolean" | "any" | "void" | UnionType | IntersectionType | ObjectType): ConstDeclaration;
namespace(name: string): NamespaceDeclaration;
objectType(members: ObjectTypeMember[]): ObjectType;
array(type: Type): ArrayTypeReference;
objectType(members: (PropertyDeclaration | MethodDeclaration)[]): ObjectType;
array(type: InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | ExportEqualsDeclaration | NamedTypeReference | ArrayTypeReference | "string" | "number" | "boolean" | "any" | "void" | UnionType | IntersectionType | ObjectType): ArrayTypeReference;
namedTypeReference(name: string): NamedTypeReference;

@@ -129,8 +129,8 @@ exportEquals(target: string): ExportEqualsDeclaration;

export declare const type: {
array(type: Type): ArrayTypeReference;
string: PrimitiveType;
number: PrimitiveType;
boolean: PrimitiveType;
any: PrimitiveType;
void: PrimitiveType;
array(type: InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | ExportEqualsDeclaration | NamedTypeReference | ArrayTypeReference | "string" | "number" | "boolean" | "any" | "void" | UnionType | IntersectionType | ObjectType): ArrayTypeReference;
string: "string" | "number" | "boolean" | "any" | "void";
number: "string" | "number" | "boolean" | "any" | "void";
boolean: "string" | "number" | "boolean" | "any" | "void";
any: "string" | "number" | "boolean" | "any" | "void";
void: "string" | "number" | "boolean" | "any" | "void";
};

@@ -137,0 +137,0 @@ export declare const reservedWords: string[];

@@ -9,2 +9,3 @@ "use strict";

DeclarationFlags[DeclarationFlags["Export"] = 16] = "Export";
DeclarationFlags[DeclarationFlags["Abstract"] = 32] = "Abstract";
})(exports.DeclarationFlags || (exports.DeclarationFlags = {}));

@@ -31,3 +32,4 @@ var DeclarationFlags = exports.DeclarationFlags;

name: name,
members: []
members: [],
implements: []
};

@@ -172,9 +174,24 @@ },

}
function flagsToString(flags) {
function classFlagsToString(flags) {
var out = '';
if (flags & DeclarationFlags.Abstract) {
out += 'abstract ';
}
return out;
}
function memberFlagsToString(flags) {
var out = '';
if (flags & DeclarationFlags.Private) {
out += 'private ';
}
else if (flags & DeclarationFlags.Protected) {
out += 'protected ';
}
if (flags & DeclarationFlags.Static) {
return 'static ';
out += 'static ';
}
else {
return '';
if (flags & DeclarationFlags.Abstract) {
out += 'abstract ';
}
return out;
}

@@ -321,2 +338,3 @@ function startWithDeclareOrExport(s, flags) {

printObjectTypeMembers(d.members);
newline();
}

@@ -326,3 +344,3 @@ function writeFunction(f) {

if (!isIdentifier(f.name)) {
start("/* Illegal functoin name '" + f.name + "' can't be used here");
start("/* Illegal function name '" + f.name + "' can't be used here");
newline();

@@ -358,7 +376,23 @@ }

printDeclarationComments(c);
startWithDeclareOrExport("class " + c.name + " {", c.flags);
startWithDeclareOrExport(classFlagsToString(c.flags) + "class " + c.name + " ", c.flags);
if (c.baseType) {
print('extends ');
writeReference(c.baseType);
}
if (c.implements && c.implements.length) {
print("implements ");
var first = true;
for (var _i = 0, _a = c.implements; _i < _a.length; _i++) {
var impl = _a[_i];
if (!first)
print(', ');
writeReference(impl);
first = false;
}
}
print('{');
newline();
indentLevel++;
for (var _i = 0, _a = c.members; _i < _a.length; _i++) {
var m = _a[_i];
for (var _b = 0, _c = c.members; _b < _c.length; _b++) {
var m = _c[_b];
writeClassMember(m);

@@ -389,3 +423,3 @@ }

printDeclarationComments(p);
start("" + flagsToString(p.flags) + quoteIfNeeded(p.name) + ": ");
start("" + memberFlagsToString(p.flags) + quoteIfNeeded(p.name) + ": ");
writeReference(p.type);

@@ -397,3 +431,3 @@ print(';');

printDeclarationComments(m);
start("" + flagsToString(m.flags) + quoteIfNeeded(m.name) + "(");
start("" + memberFlagsToString(m.flags) + quoteIfNeeded(m.name) + "(");
writeDelimited(m.parameters, ', ', writeParameter);

@@ -400,0 +434,0 @@ print('): ');

{
"name": "dts-dom",
"version": "0.1.8",
"version": "0.1.9",
"homepage": "https://github.com/RyanCavanaugh/dts-dom",

@@ -9,3 +9,4 @@ "description": "DOM for TypeScript Declaration Files",

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "tsc -p .",
"prepublish": "npm run build"
},

@@ -12,0 +13,0 @@ "author": "Ryan Cavanaugh",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc