Skip to content

Commit

Permalink
Update typings
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya committed Oct 9, 2016
1 parent 08496c3 commit f9272d1
Show file tree
Hide file tree
Showing 15 changed files with 5,087 additions and 653 deletions.
4 changes: 4 additions & 0 deletions custom-typings/object.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Node v4+ support Object.assign
interface ObjectConstructor {
assign(target: any, ...sources: any[]): any;
}
4 changes: 4 additions & 0 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
"rewriteTsconfig": false
},
"filesGlob": [
"../custom-typings/**/*.d.ts",
"../typings/**/*.d.ts",
"./*.ts"
],
"files": [
"../custom-typings/object.d.ts",
"../custom-typings/resolve.d.ts",
"../typings/colors/colors.d.ts",
"../typings/diff/diff.d.ts",
"../typings/findup-sync/findup-sync.d.ts",
Expand All @@ -24,6 +27,7 @@
"../typings/minimatch/minimatch.d.ts",
"../typings/node/node.d.ts",
"../typings/optimist/optimist.d.ts",
"../typings/tsd.d.ts",
"../typings/underscore.string/underscore.string.d.ts",
"../typings/underscore/underscore.d.ts",
"buildDocs.ts"
Expand Down
6 changes: 4 additions & 2 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.2",
"version": "1.8.10",
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
Expand All @@ -22,6 +22,7 @@
"./test/**/*.ts"
],
"files": [
"../custom-typings/object.d.ts",
"../custom-typings/resolve.d.ts",
"../typings/colors/colors.d.ts",
"../typings/diff/diff.d.ts",
Expand All @@ -31,6 +32,7 @@
"../typings/minimatch/minimatch.d.ts",
"../typings/node/node.d.ts",
"../typings/optimist/optimist.d.ts",
"../typings/tsd.d.ts",
"../typings/underscore.string/underscore.string.d.ts",
"../typings/underscore/underscore.d.ts",
"configuration.ts",
Expand Down Expand Up @@ -157,4 +159,4 @@
"test/parse.ts",
"test/utils.ts"
]
}
}
6 changes: 4 additions & 2 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.2",
"version": "1.8.10",
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
Expand All @@ -20,6 +20,7 @@
"./rule-tester/*.ts"
],
"files": [
"../custom-typings/object.d.ts",
"../custom-typings/resolve.d.ts",
"../typings/colors/colors.d.ts",
"../typings/diff/diff.d.ts",
Expand All @@ -29,6 +30,7 @@
"../typings/minimatch/minimatch.d.ts",
"../typings/node/node.d.ts",
"../typings/optimist/optimist.d.ts",
"../typings/tsd.d.ts",
"../typings/underscore.string/underscore.string.d.ts",
"../typings/underscore/underscore.d.ts",
"typings/chai/chai.d.ts",
Expand Down Expand Up @@ -179,4 +181,4 @@
"rule-tester/testData.ts",
"rule-tester/utilsTests.ts"
]
}
}
20 changes: 10 additions & 10 deletions tsd.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
"bundle": "typings/tsd.d.ts",
"installed": {
"colors/colors.d.ts": {
"commit": "78ba6e41543e5ababbd1dda19797601be3c1f304"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"diff/diff.d.ts": {
"commit": "78ba6e41543e5ababbd1dda19797601be3c1f304"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"findup-sync/findup-sync.d.ts": {
"commit": "98d3168c2c570352a3a7393788e2ec9fbb08ade6"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"glob/glob.d.ts": {
"commit": "fb2b3b1e068c9ff7d8f9b0851c08d37d96c95c38"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"js-yaml/js-yaml.d.ts": {
"commit": "8ea42cd8bb11863ed6f242d67c502288ebc45a7b"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"minimatch/minimatch.d.ts": {
"commit": "98d3168c2c570352a3a7393788e2ec9fbb08ade6"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"node/node.d.ts": {
"commit": "98d3168c2c570352a3a7393788e2ec9fbb08ade6"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"optimist/optimist.d.ts": {
"commit": "e8f8e7471b8ca92ca417f8c878f64ae4d1067972"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"underscore.string/underscore.string.d.ts": {
"commit": "98d3168c2c570352a3a7393788e2ec9fbb08ade6"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
},
"underscore/underscore.d.ts": {
"commit": "98d3168c2c570352a3a7393788e2ec9fbb08ade6"
"commit": "e623c6b3164bb8c6da508f84f7865eaaa97e1a0f"
}
}
}
18 changes: 16 additions & 2 deletions typings/colors/colors.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// Type definitions for Colors.js 0.6.0-1
// Project: https://github.com/Marak/colors.js
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare module "colors" {
interface Color {
(text: string): string;

strip: Color;
stripColors: Color;

black: Color;
red: Color;
green: Color;
Expand Down Expand Up @@ -41,11 +44,17 @@ declare module "colors" {
america: Color;
trap: Color;
random: Color;
zalgo: Color;
}

module e {
namespace e {
export function setTheme(theme:any): void;

export var enabled: boolean;

export var strip: Color;
export var stripColors: Color;

export var black: Color;
export var red: Color;
export var green: Color;
Expand Down Expand Up @@ -80,12 +89,16 @@ declare module "colors" {
export var america: Color;
export var trap: Color;
export var random: Color;
export var zalgo: Color;
}

export = e;
}

interface String {
strip: string;
stripColors: string;

black: string;
red: string;
green: string;
Expand Down Expand Up @@ -120,4 +133,5 @@ interface String {
america: string;
trap: string;
random: string;
zalgo: string;
}
37 changes: 33 additions & 4 deletions typings/diff/diff.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Type definitions for diff
// Project: https://github.com/kpdecker/jsdiff
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare module JsDiff {
declare namespace JsDiff {
interface IDiffResult {
value: string;
count?: number;
added?: boolean;
removed?: boolean;
}
Expand All @@ -15,6 +16,22 @@ declare module JsDiff {
componenets: IDiffResult[];
}

interface IHunk {
oldStart: number;
oldLines: number;
newStart: number;
newLines: number;
lines: string[];
}

interface IUniDiff {
oldFileName: string;
newFileName: string;
oldHeader: string;
newHeader: string;
hunks: IHunk[];
}

class Diff {
ignoreWhitespace:boolean;

Expand Down Expand Up @@ -45,9 +62,21 @@ declare module JsDiff {

function diffCss(oldStr:string, newStr:string):IDiffResult[];

function createPatch(fileName:string, oldStr:string, newStr:string, oldHeader:string, newHeader:string):string;
function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string;

function createTwoFilesPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string;

function structuredPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): IUniDiff;

function applyPatch(oldStr: string, uniDiff: string | IUniDiff | IUniDiff[]): string;

function applyPatches(uniDiff: IUniDiff[], options: {
loadFile: (index: number, callback: (err: Error, data: string) => void) => void,
patched: (index: number, content: string) => void,
complete: (err?: Error) => void
}): void;

function applyPatch(oldStr:string, uniDiff:string):string;
function parsePatch(diffStr: string, options?: {strict: boolean}): IUniDiff[];

function convertChangesToXML(changes:IDiffResult[]):string;

Expand Down
2 changes: 1 addition & 1 deletion typings/findup-sync/findup-sync.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Type definitions for findup-sync v0.3.0
// Project: https://github.com/cowboy/node-findup-sync
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Nathan Brown <https://github.com/ngbrown>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference path="../minimatch/minimatch.d.ts" />

Expand Down
4 changes: 2 additions & 2 deletions typings/glob/glob.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Type definitions for Glob 5.0.10
// Project: https://github.com/isaacs/node-glob
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference path="../node/node.d.ts" />
/// <reference path="../minimatch/minimatch.d.ts" />
Expand All @@ -15,7 +15,7 @@ declare module "glob" {
function G(pattern: string, cb: (err: Error, matches: string[]) => void): void;
function G(pattern: string, options: G.IOptions, cb: (err: Error, matches: string[]) => void): void;

module G {
namespace G {
function sync(pattern: string, options?: IOptions): string[];

function hasMagic(pattern: string, options?: IOptions): boolean;
Expand Down
45 changes: 39 additions & 6 deletions typings/js-yaml/js-yaml.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
// Type definitions for js-yaml 3.0.2
// Type definitions for js-yaml 3.5.2
// Project: https://github.com/nodeca/js-yaml
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Sebastian Clausen <https://github.com/sclausen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare module jsyaml {
declare namespace jsyaml {
export function safeLoad(str: string, opts?: LoadOptions): any;
export function load(str: string, opts?: LoadOptions): any;

export class Type implements TypeConstructorOptions {
constructor(tag: string, opts?: TypeConstructorOptions);
tag: string;
}
export class Schema {
constructor(definition: SchemaDefinition);
public static create(args: any[]): Schema;
}

export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;
export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;

export function safeDump(obj: any, opts?: DumpOptions): string;
export function dump(obj: any, opts?: DumpOptions): string
export function dump(obj: any, opts?: DumpOptions): string;

export interface LoadOptions {
// string to be used as a file path in error/warning messages.
Expand All @@ -29,12 +38,29 @@ declare module jsyaml {
skipInvalid?: boolean;
// specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere
flowLevel?: number;
// Each tag may have own set of styles. - "tag" => "style" map.
// Each tag may have own set of styles. - "tag" => "style" map.
styles?: Object;
// specifies a schema to use.
schema?: any;
}

export interface TypeConstructorOptions {
kind?: string;
resolve?: Function;
construct?: Function;
instanceOf?: Object;
predicate?: string;
represent?: Function;
defaultStyle?: string;
styleAliases?: Object;
}

export interface SchemaDefinition {
implicit?: any[];
explicit?: any[];
include?: any[];
}

// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
export var FAILSAFE_SCHEMA: any;
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
Expand All @@ -45,6 +71,13 @@ declare module jsyaml {
export var DEFAULT_SAFE_SCHEMA: any;
// all supported YAML types.
export var DEFAULT_FULL_SCHEMA: any;
export var MINIMAL_SCHEMA: any;
export var SAFE_SCHEMA: any;

export class YAMLException extends Error {
constructor(reason?: any, mark?: any);
toString(compact?: boolean): string;
}
}

declare module 'js-yaml' {
Expand Down
6 changes: 3 additions & 3 deletions typings/minimatch/minimatch.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Type definitions for Minimatch 2.0.8
// Project: https://github.com/isaacs/minimatch
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare module "minimatch" {

function M(target: string, pattern: string, options?: M.IOptions): boolean;

module M {
namespace M {
function match(list: string[], pattern: string, options?: IOptions): string[];
function filter(pattern: string, options?: IOptions): (element: string, indexed: number, array: string[]) => boolean;
function makeRe(pattern: string, options?: IOptions): RegExp;

var Minimatch: IMinimatchStatic;

interface IOptions {
debug?: boolean;
nobrace?: boolean;
Expand Down
Loading

0 comments on commit f9272d1

Please sign in to comment.