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