mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Merge branch 'master' into master
This commit is contained in:
2
types/codemirror/index.d.ts
vendored
2
types/codemirror/index.d.ts
vendored
@@ -692,7 +692,7 @@ declare namespace CodeMirror {
|
||||
|
||||
interface EditorChangeCancellable extends CodeMirror.EditorChange {
|
||||
/** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. */
|
||||
update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string): void;
|
||||
update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void;
|
||||
|
||||
cancel(): void;
|
||||
}
|
||||
|
||||
20
types/gulp-jasmine/gulp-jasmine-tests.ts
Normal file
20
types/gulp-jasmine/gulp-jasmine-tests.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import gulpJasmine = require("gulp-jasmine");
|
||||
import jasmine = require("jasmine");
|
||||
|
||||
const dummyReporter: jasmine.CustomReporter = {};
|
||||
|
||||
gulpJasmine(); // $ExpectType ReadWriteStream
|
||||
gulpJasmine({});
|
||||
gulpJasmine({
|
||||
verbose: true,
|
||||
includeStackTrace: true,
|
||||
reporter: dummyReporter,
|
||||
timeout: 1000,
|
||||
errorOnFail: false,
|
||||
config: {}
|
||||
});
|
||||
gulpJasmine({ reporter: [dummyReporter, dummyReporter] });
|
||||
const readonlyDummyReporters: ReadonlyArray<jasmine.CustomReporter> = [
|
||||
dummyReporter, dummyReporter
|
||||
];
|
||||
gulpJasmine({ reporter: readonlyDummyReporters });
|
||||
50
types/gulp-jasmine/index.d.ts
vendored
Normal file
50
types/gulp-jasmine/index.d.ts
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
// Type definitions for gulp-jasmine 2.4
|
||||
// Project: https://github.com/sindresorhus/gulp-jasmine#readme
|
||||
// Definitions by: Andrey Lalev <https://github.com/andypyrope>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
/// <reference types="jasmine" />
|
||||
|
||||
interface JasmineOptions {
|
||||
/**
|
||||
* Display spec names in default reporter.
|
||||
*/
|
||||
verbose?: boolean;
|
||||
|
||||
/**
|
||||
* Include stack traces in failures in default reporter.
|
||||
* @default false
|
||||
*/
|
||||
includeStackTrace?: boolean;
|
||||
|
||||
/**
|
||||
* Reporter(s) to use.
|
||||
*/
|
||||
reporter?: jasmine.CustomReporter | ReadonlyArray<jasmine.CustomReporter>;
|
||||
|
||||
/**
|
||||
* Time to wait in milliseconds before a test automatically fails.
|
||||
* @default 5000
|
||||
*/
|
||||
timeout?: number;
|
||||
|
||||
/**
|
||||
* Stops the stream on failed tests.
|
||||
* @default true
|
||||
*/
|
||||
errorOnFail?: boolean;
|
||||
|
||||
/**
|
||||
* Passes the config to Jasmine's loadConfig method.
|
||||
*/
|
||||
config?: object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes Jasmine tests. Emits a 'jasmineDone' event on success.
|
||||
* @param options Optional options for the execution of the Jasmine test
|
||||
*/
|
||||
declare function gulpJasmine(options?: JasmineOptions): NodeJS.ReadWriteStream;
|
||||
export = gulpJasmine;
|
||||
23
types/gulp-jasmine/tsconfig.json
Normal file
23
types/gulp-jasmine/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",
|
||||
"gulp-jasmine-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/gulp-jasmine/tslint.json
Normal file
1
types/gulp-jasmine/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
16
types/gzip-size/index.d.ts
vendored
16
types/gzip-size/index.d.ts
vendored
@@ -1,13 +1,19 @@
|
||||
// Type definitions for gzip-size 3.0
|
||||
// Type definitions for gzip-size 4.0
|
||||
// Project: https://github.com/sindresorhus/gzip-size
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Jimi van der Woning <https://github.com/jimivdw>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare function gzipSize(input: string | Buffer, callback: (error: Error, size: number) => void): string;
|
||||
export = gzipSize;
|
||||
import * as stream from 'stream';
|
||||
import * as zlib from 'zlib';
|
||||
|
||||
declare function gzipSize(input: string | Buffer, options?: zlib.ZlibOptions): Promise<number>;
|
||||
|
||||
declare namespace gzipSize {
|
||||
function sync(input: string | Buffer): number;
|
||||
function stream(): NodeJS.ReadWriteStream;
|
||||
function sync(input: string | Buffer, options?: zlib.ZlibOptions): number;
|
||||
function stream(options?: zlib.ZlibOptions): stream.PassThrough;
|
||||
}
|
||||
|
||||
export = gzipSize;
|
||||
|
||||
7
types/gzip-size/v3/gzip-size-tests.ts
Normal file
7
types/gzip-size/v3/gzip-size-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import gzipSize = require('gzip-size');
|
||||
|
||||
const string = 'Lorem ipsum dolor sit amet.';
|
||||
|
||||
console.log(string.length);
|
||||
|
||||
console.log(gzipSize.sync(string));
|
||||
13
types/gzip-size/v3/index.d.ts
vendored
Normal file
13
types/gzip-size/v3/index.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for gzip-size 3.0
|
||||
// Project: https://github.com/sindresorhus/gzip-size
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare function gzipSize(input: string | Buffer, callback: (error: Error, size: number) => void): string;
|
||||
export = gzipSize;
|
||||
declare namespace gzipSize {
|
||||
function sync(input: string | Buffer): number;
|
||||
function stream(): NodeJS.ReadWriteStream;
|
||||
}
|
||||
28
types/gzip-size/v3/tsconfig.json
Normal file
28
types/gzip-size/v3/tsconfig.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"types": [],
|
||||
"paths": {
|
||||
"gzip-size": [
|
||||
"gzip-size/v3"
|
||||
]
|
||||
},
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gzip-size-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/gzip-size/v3/tslint.json
Normal file
3
types/gzip-size/v3/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
10
types/puppeteer/index.d.ts
vendored
10
types/puppeteer/index.d.ts
vendored
@@ -477,7 +477,7 @@ export interface JSHandle {
|
||||
/**
|
||||
* Returns a ElementHandle
|
||||
*/
|
||||
asElement(): ElementHandle;
|
||||
asElement(): ElementHandle | null;
|
||||
/**
|
||||
* Stops referencing the element handle.
|
||||
*/
|
||||
@@ -736,7 +736,7 @@ export interface Frame extends FrameBase {
|
||||
/** Returns frame's name attribute as specified in the tag. */
|
||||
name(): string;
|
||||
/** Returns parent frame, if any. Detached frames and main frames return null. */
|
||||
parentFrame(): Frame | undefined;
|
||||
parentFrame(): Frame | null;
|
||||
}
|
||||
|
||||
export interface PageEventObj {
|
||||
@@ -872,20 +872,20 @@ export interface Page extends FrameBase {
|
||||
* Navigate to the previous page in history.
|
||||
* @param options The navigation parameters.
|
||||
*/
|
||||
goBack(options?: Partial<NavigationOptions>): Promise<Response>;
|
||||
goBack(options?: Partial<NavigationOptions>): Promise<Response | null>;
|
||||
|
||||
/**
|
||||
* Navigate to the next page in history.
|
||||
* @param options The navigation parameters.
|
||||
*/
|
||||
goForward(options?: Partial<NavigationOptions>): Promise<Response>;
|
||||
goForward(options?: Partial<NavigationOptions>): Promise<Response | null>;
|
||||
|
||||
/**
|
||||
* Navigates to a URL.
|
||||
* @param url URL to navigate page to. The url should include scheme, e.g. `https://`
|
||||
* @param options The navigation parameters.
|
||||
*/
|
||||
goto(url: string, options?: Partial<NavigationOptions>): Promise<Response>;
|
||||
goto(url: string, options?: Partial<NavigationOptions>): Promise<Response | null>;
|
||||
|
||||
/**
|
||||
* This method fetches an element with `selector`, scrolls it into view if needed,
|
||||
|
||||
@@ -150,9 +150,8 @@ puppeteer.launch().then(async browser => {
|
||||
browser.close();
|
||||
});
|
||||
|
||||
const inputElement = await page.$("input[type=submit]");
|
||||
if (inputElement)
|
||||
await inputElement.click();
|
||||
const inputElement = (await page.$("input[type=submit]"))!;
|
||||
await inputElement.click();
|
||||
});
|
||||
|
||||
// Example with launch options
|
||||
@@ -179,9 +178,9 @@ puppeteer.launch().then(async browser => {
|
||||
}
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
const button = await page.$("#myButton");
|
||||
const div = await page.$("#myDiv");
|
||||
const input = await page.$("#myInput");
|
||||
const button = (await page.$("#myButton"))!;
|
||||
const div = (await page.$("#myDiv"))!;
|
||||
const input = (await page.$("#myInput"))!;
|
||||
|
||||
if (!button)
|
||||
throw new Error('Unable to select myButton');
|
||||
@@ -230,11 +229,10 @@ puppeteer.launch().then(async browser => {
|
||||
console.log(navResponse.ok, navResponse.status, navResponse.url, navResponse.headers);
|
||||
|
||||
// evaluate example
|
||||
const bodyHandle = await page.$('body');
|
||||
if (bodyHandle) {
|
||||
const html = await page.evaluate(body => body.innerHTML, bodyHandle);
|
||||
await bodyHandle.dispose();
|
||||
}
|
||||
const bodyHandle = (await page.$('body'))!;
|
||||
const html = await page.evaluate(body => body.innerHTML, bodyHandle);
|
||||
await bodyHandle.dispose();
|
||||
|
||||
// getProperties example
|
||||
const handle = await page.evaluateHandle(() => ({ window, document }));
|
||||
const properties = await handle.getProperties();
|
||||
|
||||
16
types/react-native-elements/index.d.ts
vendored
16
types/react-native-elements/index.d.ts
vendored
@@ -354,11 +354,25 @@ export interface ButtonProps extends TouchableWithoutFeedbackProps {
|
||||
containerViewStyle?: StyleProp<ViewStyle>;
|
||||
|
||||
/**
|
||||
* Indicates button is loading
|
||||
* Styling for loading spinner
|
||||
*
|
||||
* @default null
|
||||
*/
|
||||
activityIndicatorStyle?: StyleProp<ViewStyle>;
|
||||
|
||||
/**
|
||||
* Display a loading spinner
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean;
|
||||
|
||||
/**
|
||||
* Display the spinner to the right
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
loadingRight?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
6
types/react-native/index.d.ts
vendored
6
types/react-native/index.d.ts
vendored
@@ -618,6 +618,10 @@ export interface ShadowPropTypesIOSStatic {
|
||||
shadowRadius: number
|
||||
}
|
||||
|
||||
type GeoConfiguration = {
|
||||
skipPermissionRequests: boolean;
|
||||
}
|
||||
|
||||
type GeoOptions = {
|
||||
timeout?: number,
|
||||
maximumAge?: number,
|
||||
@@ -8089,6 +8093,8 @@ export interface GeolocationStatic {
|
||||
stopObserving(): void
|
||||
|
||||
requestAuthorization(): void;
|
||||
|
||||
setRNConfiguration(config: GeoConfiguration): void;
|
||||
}
|
||||
|
||||
export interface OpenCameraDialogOptions {
|
||||
|
||||
232
types/shelljs/index.d.ts
vendored
232
types/shelljs/index.d.ts
vendored
@@ -19,14 +19,14 @@ export function cd(dir: string): void;
|
||||
* Returns the current directory.
|
||||
* @return The current directory.
|
||||
*/
|
||||
export function pwd(): string;
|
||||
export function pwd(): ShellString;
|
||||
|
||||
/**
|
||||
* Returns array of files in the given path, or in current directory if no path provided.
|
||||
* @param ...paths Paths to search.
|
||||
* @return An array of files in the given path(s).
|
||||
*/
|
||||
export function ls(...paths: string[]): string[];
|
||||
export function ls(...paths: Array<string | string[]>): ShellArray;
|
||||
|
||||
/**
|
||||
* Returns array of files in the given path, or in current directory if no path provided.
|
||||
@@ -34,50 +34,21 @@ export function ls(...paths: string[]): string[];
|
||||
* @param ...paths Paths to search.
|
||||
* @return An array of files in the given path(s).
|
||||
*/
|
||||
export function ls(options: string, ...paths: string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns array of files in the given path, or in current directory if no path provided.
|
||||
* @param paths Paths to search.
|
||||
* @return An array of files in the given path(s).
|
||||
*/
|
||||
export function ls(paths: string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns array of files in the given path, or in current directory if no path provided.
|
||||
* @param options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..)
|
||||
* @param paths Paths to search.
|
||||
* @return An array of files in the given path(s).
|
||||
*/
|
||||
export function ls(options: string, paths: string[]): string[];
|
||||
export function ls(options: string, ...paths: Array<string | string[]>): ShellArray;
|
||||
|
||||
/**
|
||||
* Returns array of all files (however deep) in the given paths.
|
||||
* @param ...path The path(s) to search.
|
||||
* @return An array of all files (however deep) in the given path(s).
|
||||
*/
|
||||
export function find(...path: string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns array of all files (however deep) in the given paths.
|
||||
* @param path The path(s) to search.
|
||||
* @return An array of all files (however deep) in the given path(s).
|
||||
*/
|
||||
export function find(path: string[]): string[];
|
||||
export function find(...path: Array<string | string[]>): ShellArray;
|
||||
|
||||
/**
|
||||
* Copies files. The wildcard * is accepted.
|
||||
* @param source The source.
|
||||
* @param dest The destination.
|
||||
*/
|
||||
export function cp(source: string, dest: string): void;
|
||||
|
||||
/**
|
||||
* Copies files. The wildcard * is accepted.
|
||||
* @param source The source.
|
||||
* @param dest The destination.
|
||||
*/
|
||||
export function cp(source: string[], dest: string): void;
|
||||
export function cp(source: string | string[], dest: string): void;
|
||||
|
||||
/**
|
||||
* Copies files. The wildcard * is accepted.
|
||||
@@ -85,81 +56,40 @@ export function cp(source: string[], dest: string): void;
|
||||
* @param source The source.
|
||||
* @param dest The destination.
|
||||
*/
|
||||
export function cp(options: string, source: string, dest: string): void;
|
||||
|
||||
/**
|
||||
* Copies files. The wildcard * is accepted.
|
||||
* @param options Available options: -f (force), -r, -R (recursive)
|
||||
* @param source The source.
|
||||
* @param dest The destination.
|
||||
*/
|
||||
export function cp(options: string, source: string[], dest: string): void;
|
||||
export function cp(options: string, source: string | string[], dest: string): void;
|
||||
|
||||
/**
|
||||
* Removes files. The wildcard * is accepted.
|
||||
* @param ...files Files to remove.
|
||||
*/
|
||||
export function rm(...files: string[]): void;
|
||||
|
||||
/**
|
||||
* Removes files. The wildcard * is accepted.
|
||||
* @param files Files to remove.
|
||||
*/
|
||||
export function rm(files: string[]): void;
|
||||
export function rm(...files: Array<string | string[]>): void;
|
||||
|
||||
/**
|
||||
* Removes files. The wildcard * is accepted.
|
||||
* @param options Available options: -f (force), -r, -R (recursive)
|
||||
* @param ...files Files to remove.
|
||||
*/
|
||||
export function rm(options: string, ...files: string[]): void;
|
||||
|
||||
/**
|
||||
* Removes files. The wildcard * is accepted.
|
||||
* @param options Available options: -f (force), -r, -R (recursive)
|
||||
* @param ...files Files to remove.
|
||||
*/
|
||||
export function rm(options: string, files: string[]): void;
|
||||
export function rm(options: string, ...files: Array<string | string[]>): void;
|
||||
|
||||
/**
|
||||
* Moves files. The wildcard * is accepted.
|
||||
* @param source The source.
|
||||
* @param dest The destination.
|
||||
*/
|
||||
export function mv(source: string, dest: string): void;
|
||||
|
||||
/**
|
||||
* Moves files. The wildcard * is accepted.
|
||||
* @param source The source.
|
||||
* @param dest The destination.
|
||||
*/
|
||||
export function mv(source: string[], dest: string): void;
|
||||
export function mv(source: string | string[], dest: string): void;
|
||||
|
||||
/**
|
||||
* Creates directories.
|
||||
* @param ...dir Directories to create.
|
||||
*/
|
||||
export function mkdir(...dir: string[]): void;
|
||||
|
||||
/**
|
||||
* Creates directories.
|
||||
* @param dir Directories to create.
|
||||
*/
|
||||
export function mkdir(dir: string[]): void;
|
||||
export function mkdir(...dir: Array<string | string[]>): void;
|
||||
|
||||
/**
|
||||
* Creates directories.
|
||||
* @param options Available options: p (full paths, will create intermediate dirs if necessary)
|
||||
* @param ...dir The directories to create.
|
||||
*/
|
||||
export function mkdir(options: string, ...dir: string[]): void;
|
||||
|
||||
/**
|
||||
* Creates directories.
|
||||
* @param options Available options: p (full paths, will create intermediate dirs if necessary)
|
||||
* @param dir The directories to create.
|
||||
*/
|
||||
export function mkdir(options: string, dir: string[]): void;
|
||||
export function mkdir(options: string, ...dir: Array<string | string[]>): void;
|
||||
|
||||
/**
|
||||
* Evaluates expression using the available primaries and returns corresponding value.
|
||||
@@ -174,29 +104,7 @@ export function test(option: string, path: string): boolean;
|
||||
* @param ...files Files to use.
|
||||
* @return A string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file).
|
||||
*/
|
||||
export function cat(...files: string[]): string;
|
||||
|
||||
/**
|
||||
* Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). Wildcard * accepted.
|
||||
* @param files Files to use.
|
||||
* @return A string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file).
|
||||
*/
|
||||
export function cat(files: string[]): string;
|
||||
|
||||
// Does not work yet.
|
||||
export interface String {
|
||||
/**
|
||||
* Analogous to the redirection operator > in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc). Like Unix redirections, to() will overwrite any existing file!
|
||||
* @param file The file to use.
|
||||
*/
|
||||
to(file: string): void;
|
||||
|
||||
/**
|
||||
* Analogous to the redirect-and-append operator >> in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc).
|
||||
* @param file The file to append to.
|
||||
*/
|
||||
toEnd(file: string): void;
|
||||
}
|
||||
export function cat(...files: Array<string | string[]>): ShellString;
|
||||
|
||||
/**
|
||||
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
|
||||
@@ -205,16 +113,7 @@ export interface String {
|
||||
* @param file The file to process.
|
||||
* @return The new string after replacement.
|
||||
*/
|
||||
export function sed(searchRegex: RegExp, replacement: string, file: string): string;
|
||||
|
||||
/**
|
||||
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
|
||||
* @param searchRegex The regular expression to use for search.
|
||||
* @param replacement The replacement.
|
||||
* @param file The file to process.
|
||||
* @return The new string after replacement.
|
||||
*/
|
||||
export function sed(searchRegex: string, replacement: string, file: string): string;
|
||||
export function sed(searchRegex: string | RegExp, replacement: string, file: string): ShellString;
|
||||
|
||||
/**
|
||||
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
|
||||
@@ -224,17 +123,7 @@ export function sed(searchRegex: string, replacement: string, file: string): str
|
||||
* @param file The file to process.
|
||||
* @return The new string after replacement.
|
||||
*/
|
||||
export function sed(options: string, searchRegex: RegExp, replacement: string, file: string): string;
|
||||
|
||||
/**
|
||||
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
|
||||
* @param options Available options: -i (Replace contents of 'file' in-place. Note that no backups will be created!)
|
||||
* @param searchRegex The regular expression to use for search.
|
||||
* @param replacement The replacement.
|
||||
* @param file The file to process.
|
||||
* @return The new string after replacement.
|
||||
*/
|
||||
export function sed(options: string, searchRegex: string, replacement: string, file: string): string;
|
||||
export function sed(options: string, searchRegex: string | RegExp, replacement: string, file: string): ShellString;
|
||||
|
||||
/**
|
||||
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
|
||||
@@ -242,15 +131,7 @@ export function sed(options: string, searchRegex: string, replacement: string, f
|
||||
* @param ...files The files to process.
|
||||
* @return Returns a string containing all lines of the file that match the given regex_filter.
|
||||
*/
|
||||
export function grep(regex_filter: RegExp, ...files: string[]): string;
|
||||
|
||||
/**
|
||||
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
|
||||
* @param regex_filter The regular expression to use.
|
||||
* @param ...files The files to process.
|
||||
* @return Returns a string containing all lines of the file that match the given regex_filter.
|
||||
*/
|
||||
export function grep(regex_filter: RegExp, files: string[]): string;
|
||||
export function grep(regex_filter: string | RegExp, ...files: Array<string | string[]>): ShellString;
|
||||
|
||||
/**
|
||||
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
|
||||
@@ -259,51 +140,42 @@ export function grep(regex_filter: RegExp, files: string[]): string;
|
||||
* @param ...files The files to process.
|
||||
* @return Returns a string containing all lines of the file that match the given regex_filter.
|
||||
*/
|
||||
export function grep(options: string, regex_filter: string, ...files: string[]): string;
|
||||
|
||||
/**
|
||||
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
|
||||
* @param options Available options: -v (Inverse the sense of the regex and print the lines not matching the criteria.)
|
||||
* @param regex_filter The regular expression to use.
|
||||
* @param files The files to process.
|
||||
* @return Returns a string containing all lines of the file that match the given regex_filter.
|
||||
*/
|
||||
export function grep(options: string, regex_filter: string, files: string[]): string;
|
||||
export function grep(options: string, regex_filter: string | RegExp, ...files: Array<string | string[]>): ShellString;
|
||||
|
||||
/**
|
||||
* Searches for command in the system's PATH. On Windows looks for .exe, .cmd, and .bat extensions.
|
||||
* @param command The command to search for.
|
||||
* @return Returns string containing the absolute path to the command.
|
||||
*/
|
||||
export function which(command: string): string;
|
||||
export function which(command: string): ShellString;
|
||||
|
||||
/**
|
||||
* Prints string to stdout, and returns string with additional utility methods like .to().
|
||||
* @param ...text The text to print.
|
||||
* @return Returns the string that was passed as argument.
|
||||
*/
|
||||
export function echo(...text: string[]): string;
|
||||
export function echo(...text: string[]): ShellString;
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param dir Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(dir: "+N"): string[];
|
||||
export function pushd(dir: "+N"): ShellArray;
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param dir Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(dir: "-N"): string[];
|
||||
export function pushd(dir: "-N"): ShellArray;
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param dir Makes the current working directory be the top of the stack, and then executes the equivalent of cd dir.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(dir: string): string[];
|
||||
export function pushd(dir: string): ShellArray;
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
@@ -311,7 +183,7 @@ export function pushd(dir: string): string[];
|
||||
* @param dir Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(options: string, dir: "+N"): string[];
|
||||
export function pushd(options: string, dir: "+N"): ShellArray;
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
@@ -319,7 +191,7 @@ export function pushd(options: string, dir: "+N"): string[];
|
||||
* @param dir Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(options: string, dir: "-N"): string[];
|
||||
export function pushd(options: string, dir: "-N"): ShellArray;
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
@@ -327,34 +199,34 @@ export function pushd(options: string, dir: "-N"): string[];
|
||||
* @param dir Makes the current working directory be the top of the stack, and then executes the equivalent of cd dir.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(options: string, dir: string): string[];
|
||||
export function pushd(options: string, dir: string): ShellArray;
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param dir Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(dir: "+N"): string[];
|
||||
export function popd(dir: "+N"): ShellArray;
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(): string[];
|
||||
export function popd(): ShellArray;
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param dir Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(dir: "-N"): string[];
|
||||
export function popd(dir: "-N"): ShellArray;
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param dir You can only use -N and +N.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(dir: string): string[];
|
||||
export function popd(dir: string): ShellArray;
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
@@ -362,7 +234,7 @@ export function popd(dir: string): string[];
|
||||
* @param dir Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(options: string, dir: "+N"): string[];
|
||||
export function popd(options: string, dir: "+N"): ShellArray;
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
@@ -370,7 +242,7 @@ export function popd(options: string, dir: "+N"): string[];
|
||||
* @param dir Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(options: string, dir: "-N"): string[];
|
||||
export function popd(options: string, dir: "-N"): ShellArray;
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
@@ -378,28 +250,28 @@ export function popd(options: string, dir: "-N"): string[];
|
||||
* @param dir You can only use -N and +N.
|
||||
* @return Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(options: string, dir: string): string[];
|
||||
export function popd(options: string, dir: string): ShellArray;
|
||||
|
||||
/**
|
||||
* Clears the directory stack by deleting all of the elements.
|
||||
* @param options Clears the directory stack by deleting all of the elements.
|
||||
* @return Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
*/
|
||||
export function dirs(options: "-c"): string[];
|
||||
export function dirs(options: "-c"): ShellArray;
|
||||
|
||||
/**
|
||||
* Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
* @param options Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.
|
||||
* @return Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
*/
|
||||
export function dirs(options: "+N"): string;
|
||||
export function dirs(options: "+N"): ShellString;
|
||||
|
||||
/**
|
||||
* Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
* @param options Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.
|
||||
* @return Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
*/
|
||||
export function dirs(options: "-N"): string;
|
||||
export function dirs(options: "-N"): ShellString;
|
||||
|
||||
/**
|
||||
* Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
@@ -474,6 +346,30 @@ export interface ExecOutputReturnValue {
|
||||
stderr: string;
|
||||
}
|
||||
|
||||
export interface ShellReturnValue extends ExecOutputReturnValue {
|
||||
/**
|
||||
* Analogous to the redirection operator > in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc). Like Unix redirections, to() will overwrite any existing file!
|
||||
* @param file The file to use.
|
||||
*/
|
||||
to(file: string): void;
|
||||
|
||||
/**
|
||||
* Analogous to the redirect-and-append operator >> in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc).
|
||||
* @param file The file to append to.
|
||||
*/
|
||||
toEnd(file: string): void;
|
||||
|
||||
cat(...files: string[]): ShellString;
|
||||
exec(callback: ExecCallback): child.ChildProcess;
|
||||
exec(): ExecOutputReturnValue;
|
||||
grep(...files: Array<string | string[]>): ShellString;
|
||||
sed(replacement: string, file: string): ShellString;
|
||||
}
|
||||
|
||||
export type ShellString = string & ShellReturnValue;
|
||||
|
||||
export type ShellArray = string[] & ShellReturnValue;
|
||||
|
||||
/**
|
||||
* Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
|
||||
* - In symbolic modes, 'a-r' and '-r' are identical. No consideration is given to the umask.
|
||||
@@ -498,30 +394,28 @@ export function chmod(mode: string, file: string): void;
|
||||
* Searches and returns string containing a writeable, platform-dependent temporary directory. Follows Python's tempfile algorithm.
|
||||
* @return The temp file path.
|
||||
*/
|
||||
export function tempdir(): string;
|
||||
export function tempdir(): ShellString;
|
||||
|
||||
/**
|
||||
* Tests if error occurred in the last command.
|
||||
* @return Returns null if no error occurred, otherwise returns string explaining the error
|
||||
*/
|
||||
export function error(): string;
|
||||
export function error(): ShellString;
|
||||
|
||||
export type TouchOptionsLiteral = "-a" | "-c" | "-m" | "-d" | "-r";
|
||||
|
||||
/**
|
||||
* Update the access and modification times of each FILE to the current time. A FILE argument that does not exist is created empty, unless -c is supplied
|
||||
*/
|
||||
export interface touchOptionsArray {
|
||||
export interface TouchOptionsArray {
|
||||
'-d'?: string;
|
||||
'-r'?: string;
|
||||
}
|
||||
|
||||
export function touch(...files: string[]): void;
|
||||
export function touch(files: string[]): void;
|
||||
export function touch(options: TouchOptionsLiteral, ...files: string[]): void;
|
||||
export function touch(options: TouchOptionsLiteral, files: string[]): void;
|
||||
export function touch(options: touchOptionsArray, ...files: string[]): void;
|
||||
export function touch(options: touchOptionsArray, files: string[]): void;
|
||||
export function touch(options: TouchOptionsLiteral, ...files: Array<string | string[]>): void;
|
||||
export function touch(options: TouchOptionsArray, ...files: Array<string | string[]>): void;
|
||||
|
||||
// Configuration
|
||||
|
||||
|
||||
4
types/showdown/index.d.ts
vendored
4
types/showdown/index.d.ts
vendored
@@ -298,9 +298,9 @@ declare namespace Showdown {
|
||||
* Setting a "local" option only affects the specified Converter object.
|
||||
*
|
||||
* @param optionKey
|
||||
* @param string
|
||||
* @param value
|
||||
*/
|
||||
setOption(optionKey: string, value: string): void;
|
||||
setOption(optionKey: string, value: any): void;
|
||||
|
||||
/**
|
||||
* Get the option of this Converter instance.
|
||||
|
||||
Reference in New Issue
Block a user