UNPKG

1.03 kBTypeScriptView Raw
1import { BaseMetadata, ServiceObject } from './nodejs-common/index.js';
2import { Storage } from './storage.js';
3export interface StopCallback {
4 (err: Error | null, apiResponse?: unknown): void;
5}
6/**
7 * Create a channel object to interact with a Cloud Storage channel.
8 *
9 * See {@link https://cloud.google.com/storage/docs/object-change-notification| 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 * ```
18 * const {Storage} = require('@google-cloud/storage');
19 * const storage = new Storage();
20 * const channel = storage.channel('id', 'resource-id');
21 * ```
22 */
23declare class Channel extends ServiceObject<Channel, BaseMetadata> {
24 constructor(storage: Storage, id: string, resourceId: string);
25 stop(): Promise<unknown>;
26 stop(callback: StopCallback): void;
27}
28/**
29 * Reference to the {@link Channel} class.
30 * @name module:@google-cloud/storage.Channel
31 * @see Channel
32 */
33export { Channel };