From c5797186c2284ab8129613c8f58798a786f3c6f1 Mon Sep 17 00:00:00 2001 From: tgt Date: Wed, 31 Jul 2024 18:32:52 -0400 Subject: [PATCH] Add types for inject --- uv.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/uv.d.ts b/uv.d.ts index 4d879f90..449cf142 100644 --- a/uv.d.ts +++ b/uv.d.ts @@ -21,6 +21,23 @@ export type UVEncode = (input: Coded) => string; */ export type UVDecode = (input: Coded) => string; +export type UVInject = { + /** + * The host(s) to inject the HTML on. + * This is a regex that's tested against the proxied URL's host. + */ + host: RegExp; + /** + * Where to inject the HTML + * Possible values: `"head" | "body"` + */ + injectTo: "head" | "body"; + /** + * The HTML to inject. + */ + html: string; +} + /** * The Ultraviolet configuration object. * This interface defines the configuration options for the Ultraviolet library. @@ -88,4 +105,9 @@ export interface UVConfig { * @defaultValue `Ultraviolet.codec.xor.decode` */ decodeUrl?: UVDecode; + /** + * HTML inject settings. + * This property expects an array of `UVInject`. + */ + inject?: UVInject[]; }