diff options
Diffstat (limited to 'apps/web/src/stickers/resolver.ts')
| -rw-r--r-- | apps/web/src/stickers/resolver.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/web/src/stickers/resolver.ts b/apps/web/src/stickers/resolver.ts new file mode 100644 index 00000000..a7825bbc --- /dev/null +++ b/apps/web/src/stickers/resolver.ts @@ -0,0 +1,20 @@ +import { stickersRegistry } from "./registry"; +import { parseStickerId } from "./sticker-id"; +import { registerDefaultStickerProviders } from "./providers"; +import type { StickerResolveOptions } from "@/stickers/types"; + +export function resolveStickerId({ + stickerId, + options, +}: { + stickerId: string; + options?: StickerResolveOptions; +}): string { + registerDefaultStickerProviders(); + + const parsedStickerId = parseStickerId({ stickerId }); + return stickersRegistry.get(parsedStickerId.providerId).resolveUrl({ + stickerId, + options, + }); +} |
