mirror of
https://github.com/titaniumnetwork-dev/Ultraviolet.git
synced 2025-05-17 13:30:00 -04:00
Add types for inject (#155)
This commit is contained in:
parent
24c872b74a
commit
a117b5cf2b
1 changed files with 22 additions and 0 deletions
22
uv.d.ts
vendored
22
uv.d.ts
vendored
|
@ -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[];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue