@towns-protocol/react-sdk
Version:
React Hooks for Towns Protocol SDK
28 lines • 1.07 kB
TypeScript
import type { Gdms } from '@towns-protocol/sdk';
import { type ActionConfig } from './internals/useAction';
/**
* A hook that allows you to create a new group direct message (GDM).
* @param config - The action config.
* @returns An object containing the `createGDM` action and the rest of the action result.
*/
export declare const useCreateGdm: (config?: ActionConfig<Gdms["createGDM"]>) => {
data: {
streamId: string;
} | undefined;
error: Error | undefined;
isPending: boolean;
isSuccess: boolean;
isError: boolean;
/**
* Creates a new GDM.
* @param userIds - The `userIds` of the users to invite to the GDM.
* @returns A promise that resolves to the result of the create operation.
*/
createGDM: (userIds: string[], channelProperties?: import("@towns-protocol/proto").EncryptedData | undefined, streamSettings?: {
disableMiniblockCreation: boolean;
lightStream: boolean;
} | undefined) => Promise<{
streamId: string;
}>;
};
//# sourceMappingURL=useCreateGdm.d.ts.map