UNPKG

1.33 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt
6 * The complete set of authors may be found at
7 * http://polymer.github.io/AUTHORS.txt
8 * The complete set of contributors may be found at
9 * http://polymer.github.io/CONTRIBUTORS.txt
10 * Code distributed by Google as part of the polymer project is also
11 * subject to an additional IP rights grant found at
12 * http://polymer.github.io/PATENTS.txt
13 */
14/// <reference types="node" />
15import { Url } from 'url';
16export declare function parseUrl(url: string, defaultProtocol?: string): Url;
17export declare function ensureProtocol(url: string, defaultProtocol: string): string;
18export declare function resolveUrl(baseUrl: string, targetUrl: string, defaultProtocol: string): string;
19export declare function trimLeft(str: string, char: string): string;
20export declare class Deferred<T> {
21 promise: Promise<T>;
22 resolve: (result: T) => void;
23 reject: (error: {} | undefined | null) => void;
24 resolved: boolean;
25 rejected: boolean;
26 error: {} | undefined | null;
27 constructor();
28 toNodeCallback(): (error: {} | null | undefined, value: T) => void;
29}
30export declare function addAll<T>(set1: Set<T>, set2: Set<T>): Set<T>;