UNPKG

@ts-common/azure-js-dev-tools

Version:

Developer dependencies for TypeScript related projects

44 lines 2.14 kB
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. */ /// <reference types="node" /> export declare function arrayContains<T>(array: T[], el: T): boolean; export declare function startsWith(value: string, prefix: string): boolean; export declare function endsWith(value: string, suffix: string): boolean; export declare function contains(values: string[], searchString: string): boolean; /** * Pad the left side of the provided value to the targetLength using the provided padding. * @param value The value to pad. * @param targetLength The length to pad to. * @param padding The string to use to pad the value. Defaults to " ". * @returns The padded value. */ export declare function padLeft(value: string | number, targetLength: number, padding?: string): string; /** * A map/dictionary that maps strings to a generic type of value. */ export declare type StringMap<TValue> = { [key: string]: TValue; }; /** * Get the lines of the provided text. * @param text The text to get the lines of. */ export declare function getLines(text: string | undefined): string[]; /** * Capture and return the text from the provided readableStream. * @param readableStream The stream to read from. */ export declare function readEntireString(readableStream?: NodeJS.ReadableStream): Promise<string | undefined>; export declare function main(mainFunction: Promise<any> | (() => (any | Promise<any>))): Promise<any>; /** * Replace all of the instances of searchValue in value with the provided replaceValue. * @param {string | undefined} value The value to search and replace in. * @param {string} searchValue The value to search for in the value argument. * @param {string} replaceValue The value to replace searchValue with in the value argument. * @returns {string | undefined} The value where each instance of searchValue was replaced with replacedValue. */ export declare function replaceAll(value: string | undefined, searchValue: string, replaceValue: string): string | undefined; //# sourceMappingURL=common.d.ts.map