mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge branch 'master' of https://github.com/npenin/DefinitelyTyped into npenin-master
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for sequencify 0.1
|
||||
// Project: https://github.com/robrich/sequencify
|
||||
// Definitions by: Nicolas Penin <https://github.com/npenin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Definition file started by dts-gen
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export = sequencify;
|
||||
|
||||
declare namespace sequencify {
|
||||
interface Task {
|
||||
name: string;
|
||||
dep: string[];
|
||||
}
|
||||
|
||||
interface TaskMap {
|
||||
[name: string]: Task;
|
||||
}
|
||||
}
|
||||
|
||||
declare function sequencify<T extends sequencify.TaskMap>(tasks: T, names: Array<keyof T>, results: Array<keyof T>, nest?: string[]): void;
|
||||
@@ -0,0 +1,34 @@
|
||||
/* Add tests for your definition file here */
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import sequencify = require('sequencify');
|
||||
|
||||
const items: sequencify.TaskMap = {
|
||||
a: {
|
||||
name: 'a',
|
||||
dep: []
|
||||
// other properties as needed
|
||||
},
|
||||
b: {
|
||||
name: 'b',
|
||||
dep: ['a']
|
||||
},
|
||||
c: {
|
||||
name: 'c',
|
||||
dep: ['a']
|
||||
},
|
||||
d: {
|
||||
name: 'd',
|
||||
dep: ['c']
|
||||
},
|
||||
};
|
||||
|
||||
const names = ['d', 'b', 'c', 'a']; // The names of the items you want arranged, need not be all
|
||||
|
||||
const results: string[] = [];
|
||||
|
||||
sequencify(items, names, results);
|
||||
|
||||
console.log(results);
|
||||
// ['a','b','c','d'];
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"sequencify-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user