Huge News!Announcing our $40M Series B led by Abstract Ventures.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.17 to 0.1.18

9

bin/index.d.ts

@@ -75,2 +75,8 @@ export interface DeclarationBase {

}
export interface ImportNamedDeclaration extends DeclarationBase {
kind: "importNamed";
name: string;
as?: string;
from: string;
}
export interface ImportDefaultDeclaration extends DeclarationBase {

@@ -141,3 +147,3 @@ kind: "importDefault";

export declare type Type = TypeReference | UnionType | IntersectionType | PrimitiveType | ObjectType | TypeofReference | FunctionType | TypeParameter | ThisType;
export declare type Import = ImportAllDeclaration | ImportDefaultDeclaration;
export declare type Import = ImportAllDeclaration | ImportDefaultDeclaration | ImportNamedDeclaration;
export declare type NamespaceMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration;

@@ -189,2 +195,3 @@ export declare type ModuleMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | Import;

importDefault(name: string, from: string): ImportDefaultDeclaration;
importNamed(name: string, as: string, from?: string | undefined): ImportNamedDeclaration;
union(members: Type[]): UnionType;

@@ -191,0 +198,0 @@ typeof(type: NamedTypeReference): TypeofReference;

@@ -173,2 +173,10 @@ "use strict";

},
importNamed: function (name, as, from) {
return {
kind: 'importNamed',
name: name,
as: typeof from !== 'undefined' ? as : undefined,
from: typeof from !== 'undefined' ? from : as
};
},
union: function (members) {

@@ -657,2 +665,10 @@ return {

}
function writeImportNamed(i) {
start("import {" + i.name);
if (i.as) {
print(" as " + i.as);
}
print("} from '" + i.from + "';");
newline();
}
function writeEnum(e) {

@@ -703,2 +719,4 @@ printDeclarationComments(e);

return writeImportDefault(d);
case "importNamed":
return writeImportNamed(d);
case "enum":

@@ -705,0 +723,0 @@ return writeEnum(d);

@@ -88,2 +88,9 @@ export interface DeclarationBase {

export interface ImportNamedDeclaration extends DeclarationBase {
kind: "importNamed";
name: string;
as?: string;
from: string;
}
export interface ImportDefaultDeclaration extends DeclarationBase {

@@ -172,3 +179,3 @@ kind: "importDefault";

export type Import = ImportAllDeclaration | ImportDefaultDeclaration;
export type Import = ImportAllDeclaration | ImportDefaultDeclaration | ImportNamedDeclaration;

@@ -367,2 +374,11 @@ export type NamespaceMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration;

importNamed(name: string, as: string, from?: string): ImportNamedDeclaration {
return {
kind: 'importNamed',
name,
as: typeof from !== 'undefined' ? as : undefined,
from: typeof from !== 'undefined' ? from : as
};
},
union(members: Type[]): UnionType {

@@ -887,2 +903,11 @@ return {

function writeImportNamed(i: ImportNamedDeclaration) {
start(`import {${i.name}`);
if (i.as) {
print(` as ${i.as}`);
}
print(`} from '${i.from}';`);
newline();
}
function writeEnum(e: EnumDeclaration) {

@@ -933,2 +958,4 @@ printDeclarationComments(e);

return writeImportDefault(d);
case "importNamed":
return writeImportNamed(d);
case "enum":

@@ -935,0 +962,0 @@ return writeEnum(d);

2

package.json
{
"name": "dts-dom",
"version": "0.1.17",
"version": "0.1.18",
"homepage": "https://github.com/RyanCavanaugh/dts-dom",

@@ -5,0 +5,0 @@ "description": "DOM for TypeScript Declaration Files",

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