mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-21 18:17:05 +00:00
18 lines
787 B
TypeScript
18 lines
787 B
TypeScript
import { CLOUDFLARE_ICE_SERVER_SOURCE_ID } from "@/integrations/cloudflare/settings";
|
|
import type { IceServerSourceFactoryCatalogue } from "@vrtmrz/livesync-commonlib/p2p";
|
|
import {
|
|
createCloudflareIceServerSource,
|
|
type CloudflareIceServerSourceFetch,
|
|
} from "@/integrations/cloudflare/iceServerSource";
|
|
|
|
/**
|
|
* Compose the closed LiveSync-owned ICE source catalogue from a host HTTP
|
|
* adapter. The adapter is intentionally narrow so this feature does not take
|
|
* a dependency on LiveSync core or on native request APIs.
|
|
*/
|
|
export function useIceServerSources(fetch: CloudflareIceServerSourceFetch): IceServerSourceFactoryCatalogue {
|
|
return {
|
|
[CLOUDFLARE_ICE_SERVER_SOURCE_ID]: (configuration) => createCloudflareIceServerSource(configuration, { fetch }),
|
|
};
|
|
}
|