UNPKG

1.08 kBTypeScriptView Raw
1import { Expression } from "../params";
2/**
3 * A type alias used to annotate interfaces as using a google.protobuf.Duration.
4 * This type is parsed/encoded as a string of seconds + the "s" prefix.
5 */
6export type Duration = string;
7/** Get a google.protobuf.Duration for a number of seconds. */
8export declare function durationFromSeconds(s: number): Duration;
9/**
10 * Utility function to help copy fields from type A to B.
11 * As a safety net, catches typos or fields that aren't named the same
12 * in A and B, but cannot verify that both Src and Dest have the same type for the same field.
13 */
14export declare function copyIfPresent<Src, Dest>(dest: Dest, src: Src, ...fields: Array<keyof Src & keyof Dest>): void;
15export declare function convertIfPresent<Src, Dest>(dest: Dest, src: Src, destField: keyof Dest, srcField: keyof Src, converter?: (from: any) => any): void;
16export declare function serviceAccountFromShorthand(serviceAccount: string | Expression<string>): string | Expression<string> | null;
17export declare function convertInvoker(invoker: string | string[]): string[];