mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add types for multiple vigour.io projects (#35629)
Included projects: * is-number-like * quick-hash * turbostatus * vigour-ua
This commit is contained in:
parent
b244a1ab2e
commit
b1ca386416
13
types/is-number-like/index.d.ts
vendored
Normal file
13
types/is-number-like/index.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Type definitions for is-number-like 1.0
|
||||
// Project: https://github.com/vigour-io/is-number-like#readme
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Checks whether provided parameter looks like a number
|
||||
* @param val the value to check
|
||||
* @returns `true` if `val` looks like a number, `false` otherwise
|
||||
*/
|
||||
declare function isNumberLike(val: any): boolean;
|
||||
|
||||
export = isNumberLike;
|
||||
4
types/is-number-like/is-number-like-tests.ts
Normal file
4
types/is-number-like/is-number-like-tests.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import isNumberLike = require('is-number-like');
|
||||
|
||||
isNumberLike('2'); // $ExpectType boolean
|
||||
isNumberLike('a'); // $ExpectType boolean
|
||||
23
types/is-number-like/tsconfig.json
Normal file
23
types/is-number-like/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"is-number-like-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/is-number-like/tslint.json
Normal file
1
types/is-number-like/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
13
types/quick-hash/index.d.ts
vendored
Normal file
13
types/quick-hash/index.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Type definitions for quick-hash 1.0
|
||||
// Project: https://github.com/vigour-io/quick-hash#readme
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Murmur hash optimized for performance, not collision avoidance.
|
||||
* @param key the string to hash
|
||||
* @param seed a seed for hashing
|
||||
* @returns A string of 5 to 7 alpha-numeric characters
|
||||
*/
|
||||
declare function quickHash(key: string, seed?: number): string;
|
||||
export = quickHash;
|
||||
3
types/quick-hash/quick-hash-tests.ts
Normal file
3
types/quick-hash/quick-hash-tests.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import hash = require('quick-hash');
|
||||
hash('Any string'); // $ExpectType string
|
||||
hash('Another string', 100); // $ExpectType string
|
||||
23
types/quick-hash/tsconfig.json
Normal file
23
types/quick-hash/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"quick-hash-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/quick-hash/tslint.json
Normal file
1
types/quick-hash/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
31
types/turbostatus/index.d.ts
vendored
Normal file
31
types/turbostatus/index.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Type definitions for turbostatus 2.4
|
||||
// Project: https://github.com/vigour-io/turbostatus#readme
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Repository {
|
||||
name: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface Description {
|
||||
commitsSinceTag: string | false;
|
||||
hash: string;
|
||||
nearestTag: string | false;
|
||||
}
|
||||
|
||||
export function checkout(folder: string, commit: string): Promise<string>;
|
||||
export function clone(origin: string, folder: string): Promise<string>;
|
||||
export function describe(folder: string): Promise<Description>;
|
||||
export function getBranch(folder: string): Promise<string>;
|
||||
export function getBranchFast(folder: string): Promise<string>;
|
||||
export function getLocalCommit(folder: string): Promise<string>;
|
||||
export function getMergeBase(folder: string): Promise<string>;
|
||||
export function getOrigin(folder: string): Promise<string>;
|
||||
export function getRemoteCommit(folder: string): Promise<string>;
|
||||
export function getRepos(folder: string, wildcard?: string): Promise<Repository[]>;
|
||||
export function hasUncommited(folder: string): Promise<boolean>;
|
||||
export function hasUntracked(folder: string): Promise<boolean>;
|
||||
export function info(repo: Repository, remotes?: boolean): Promise<Repository>;
|
||||
export function isRepo(folder: string): Promise<boolean>;
|
||||
export function references(folder: string): Promise<string>;
|
||||
23
types/turbostatus/tsconfig.json
Normal file
23
types/turbostatus/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"turbostatus-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/turbostatus/tslint.json
Normal file
1
types/turbostatus/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
5
types/turbostatus/turbostatus-tests.ts
Normal file
5
types/turbostatus/turbostatus-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as turbostatus from 'turbostatus';
|
||||
|
||||
turbostatus.checkout('./', 'master');
|
||||
turbostatus.isRepo('./');
|
||||
turbostatus.describe('./');
|
||||
30
types/vigour-ua/index.d.ts
vendored
Normal file
30
types/vigour-ua/index.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Type definitions for vigour-ua 4.0
|
||||
// Project: https://github.com/vigour-io/ua#readme
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare namespace ua {
|
||||
interface UserAgent {
|
||||
[value: string]: string | number;
|
||||
browser: string;
|
||||
prefix: string;
|
||||
version: number;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object representing the user agent including data such as browser, device and platform
|
||||
* @param _ua the raw user agent string to be converted
|
||||
* @param obj object to be merged to the output result
|
||||
* @returns object representing your user agent
|
||||
*/
|
||||
declare function ua(_ua: string): ua.UserAgent;
|
||||
/**
|
||||
* Returns an object representing the user agent including data such as browser, device and platform
|
||||
* @param _ua the raw user agent string to be converted
|
||||
* @returns object representing your user agent
|
||||
*/
|
||||
declare function ua<T extends object>(_ua: string, obj: T): ua.UserAgent & T;
|
||||
|
||||
export = ua;
|
||||
23
types/vigour-ua/tsconfig.json
Normal file
23
types/vigour-ua/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"vigour-ua-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/vigour-ua/tslint.json
Normal file
1
types/vigour-ua/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
11
types/vigour-ua/vigour-ua-tests.ts
Normal file
11
types/vigour-ua/vigour-ua-tests.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import ua = require('vigour-ua');
|
||||
|
||||
const userAgent =
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.3';
|
||||
|
||||
const someObject = {
|
||||
randomField: true,
|
||||
};
|
||||
|
||||
ua(userAgent, someObject);
|
||||
ua(userAgent);
|
||||
Loading…
Reference in New Issue
Block a user