UNPKG

@azure/web-pubsub

Version:
31 lines 1.15 kB
import type { RequestBodyType } from "@azure/core-rest-pipeline"; export interface TextPlainPayload { contentType: "text/plain"; payload: string; } export interface JsonPayload { contentType: "application/json"; payload: string; } export interface BinaryPayload { contentType: "application/octet-stream"; payload: RequestBodyType; } export type Payload = TextPlainPayload | JsonPayload | BinaryPayload; export declare function getPayloadForMessage(message: unknown, options: Record<string, any>): Payload; /** * Escapes an odata filter expression to avoid errors with quoting string literals. * Example usage: * ```ts snippet:ReadmeSampleOdata * import { odata } from "@azure/web-pubsub"; * * const userId = "vic's"; * const anonymous = null; * const length = 3; * const filter = odata`userId eq ${anonymous} or userId eq ${userId} or length(userId) > ${length}`; * ``` * @param strings - Array of strings for the expression * @param values - Array of values for the expression */ export declare function odata(strings: TemplateStringsArray, ...values: unknown[]): string; //# sourceMappingURL=utils.d.ts.map