UNPKG

982 BTypeScriptView Raw
1import { Metadata, ServiceObject } from '@google-cloud/common';
2import { Storage } from './storage';
3export interface StopCallback {
4 (err: Error | null, apiResponse?: Metadata): void;
5}
6/**
7 * Create a channel object to interact with a Cloud Storage channel.
8 *
9 * @see [Object Change Notification]{@link https://cloud.google.com/storage/docs/object-change-notification}
10 *
11 * @class
12 *
13 * @param {string} id The ID of the channel.
14 * @param {string} resourceId The resource ID of the channel.
15 *
16 * @example
17 * const {Storage} = require('@google-cloud/storage');
18 * const storage = new Storage();
19 * const channel = storage.channel('id', 'resource-id');
20 */
21declare class Channel extends ServiceObject {
22 constructor(storage: Storage, id: string, resourceId: string);
23 stop(): Promise<Metadata>;
24 stop(callback: StopCallback): void;
25}
26/**
27 * Reference to the {@link Channel} class.
28 * @name module:@google-cloud/storage.Channel
29 * @see Channel
30 */
31export { Channel };