sleeveforarm
Version:
Making Azure Easy
57 lines (56 loc) • 3.31 kB
TypeScript
import * as CommonUtilities from "./common-utilities";
import IGlobalDefault from "./IGlobalDefault";
import * as IInfrastructure from "./IInfrastructure";
import IStorageResource from "./IStorageResource";
import * as Resource from "./resource";
export declare enum azCommandOutputs {
json = 0,
string = 1,
}
export interface IExecOutput {
stdout: string;
stderr: string;
}
export declare function exec(command: string, cwd: string): Promise<IExecOutput>;
export declare function runExecFailOnStderr(command: string, skipLog?: boolean): Promise<string>;
export declare function runAzCommand(command: string, output?: CommonUtilities.azCommandOutputs, retriesAfterFailure?: number): Promise<any | string>;
export declare function azAppServiceListLocations(): Promise<Array<{
name: string;
}>>;
export declare function addPasswordToGitURL(gitURL: string, password: string): string;
export declare function npmSetup(path: string): Promise<void>;
export declare function executeOnSleeveResources(parentPath: string, processFunction: (path: string) => Promise<void>): Promise<void[]>;
/**
* Javascript doesn't know what interfaces are so when one imports
* an interface in Typescript this does not produce any code in Javascript.
* But typescript still happily lets one specify (foo instance of I) where I
* is the interface. But that check won't work. So we have to do a duck
* typing check instead.
*/
export declare function isIGlobalDefault(object: any): object is IGlobalDefault;
export declare function isIStorageResource(object: any): object is IStorageResource;
export declare function isIInfrastructure(object: any): object is IInfrastructure.IInfrastructure<any>;
export declare function isResource(object: any): object is Resource.Resource;
export declare function findGlobalDefaultResourceByType(resources: Resource.Resource[], resourceType: any): Resource.Resource;
export declare function findInfraResourcesByInterface<T>(resources: Resource.Resource[] | Array<IInfrastructure.IInfrastructure<any>> | IStorageResource[], interfaceCheck: (object: any) => object is T): Array<Resource.Resource & IInfrastructure.IInfrastructure<any> & T>;
export declare const scratchDirectoryName = ".sleeve";
export declare function localScratchDirectory(targetDirectoryPath: string): string;
export declare function wait(millisecondsToWait: number): Promise<{}>;
export declare function retryAfterFailure<T>(command: () => Promise<T>, counter: number): Promise<T>;
/**
* I keep running into bizarre situations where instanceof
* just doesn't work. I checked the Javascript and I have
* no idea what's going on. But really simple checks like
* an object that says it is of type foo will return
* false to "obj instanceof foo". So I have to use this
* check instead. Note that this is NOT a substitute for
* instanceof since I don't check inheritance.
*/
export declare function isClass(obj: object, classObj: any): boolean;
export declare function validateResource(resourceName: string, length: number): boolean;
/**
* Walks up the directory hierarchy look for the root of a GIT
* project.
* @param startDir The path to start the directory walk in
*/
export declare function findGitRootDir(startDir: string): Promise<string>;