Spaces:
Running
Running
Perceptual model added
Browse files- dist/index.cjs +94 -12
- dist/index.js +94 -12
- docs/assets/hierarchy.js +1 -1
- docs/assets/main.js +5 -5
- docs/assets/navigation.js +1 -1
- docs/assets/search.js +1 -1
- docs/assets/style.css +11 -10
- docs/classes/bchecc.BCH.html +0 -0
- docs/classes/datalayer.DataLayer.html +23 -23
- docs/classes/trustmark.TrustMark.html +34 -26
- docs/functions/datalayer.getSchemaCapacity.html +2 -2
- docs/functions/datalayer.getSchemaVersion.html +2 -2
- docs/index.html +37 -187
- docs/modules.html +1 -1
- docs/modules/bchecc.html +1 -1
- docs/modules/datalayer.html +1 -1
- docs/modules/trustmark.html +1 -1
- index.html +27 -6
- index.js +7 -2
- style.css +66 -0
dist/index.cjs
CHANGED
@@ -870,6 +870,40 @@ var ONNX_HUB_MANIFEST_default = [
|
|
870 |
}
|
871 |
}
|
872 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
873 |
{
|
874 |
model: "Trustmark variant Q decoder",
|
875 |
model_name: "decoder_Q.onnx",
|
@@ -898,6 +932,35 @@ var ONNX_HUB_MANIFEST_default = [
|
|
898 |
]
|
899 |
}
|
900 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
901 |
}
|
902 |
];
|
903 |
|
@@ -926,7 +989,9 @@ var TrustMark = class _TrustMark {
|
|
926 |
ecc;
|
927 |
decoder_session;
|
928 |
encoder_session;
|
929 |
-
|
|
|
|
|
930 |
/**
|
931 |
* Constructs a new TrustMark instance.
|
932 |
* @param {boolean} [use_ecc=true] - use BCH error correction on the payload, reducing payload size (default)
|
@@ -946,7 +1011,7 @@ var TrustMark = class _TrustMark {
|
|
946 |
*/
|
947 |
async decode(image_url) {
|
948 |
tf.engine().startScope();
|
949 |
-
const stego_image = await this.loadImage(image_url);
|
950 |
await sleep(0);
|
951 |
tf.engine().endScope();
|
952 |
const input_feeds = { image: stego_image.onnx };
|
@@ -991,7 +1056,7 @@ var TrustMark = class _TrustMark {
|
|
991 |
*/
|
992 |
async encode(image_url, string_secret, wm_strength = 0.4, maculate = false, output = "bytes") {
|
993 |
tf.engine().startScope();
|
994 |
-
const cover_image = await this.loadImage(image_url);
|
995 |
let mode;
|
996 |
let secret = new Float32Array(100);
|
997 |
if (maculate === true) {
|
@@ -1107,7 +1172,7 @@ var TrustMark = class _TrustMark {
|
|
1107 |
* @param image The input image data.
|
1108 |
* @returns A promise that resolves with the processed image data or rejects with an error.
|
1109 |
*/
|
1110 |
-
async processImage(image2) {
|
1111 |
const start_time = /* @__PURE__ */ new Date();
|
1112 |
image2.width = image2.tf_source.shape[2];
|
1113 |
image2.height = image2.tf_source.shape[1];
|
@@ -1141,7 +1206,11 @@ var TrustMark = class _TrustMark {
|
|
1141 |
const onnxTensor = new ort.Tensor("float32", data, image2.tf_crop.shape);
|
1142 |
image2.tf_crop = image2.tf_crop.transpose([0, 2, 3, 1]);
|
1143 |
image2.tf_crop = image2.tf_crop.squeeze();
|
1144 |
-
|
|
|
|
|
|
|
|
|
1145 |
await sleep(0);
|
1146 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1147 |
tsLog(`Processing: ${image2.width}x${image2.height}: ${time_elapsed}ms`);
|
@@ -1153,7 +1222,7 @@ var TrustMark = class _TrustMark {
|
|
1153 |
* @param image_url The URL of the image to load.
|
1154 |
* @returns A promise that resolves with the processed image data or rejects with an error.
|
1155 |
*/
|
1156 |
-
async loadImage(image_url) {
|
1157 |
return new Promise(async (resolve) => {
|
1158 |
const start_time = /* @__PURE__ */ new Date();
|
1159 |
const image2 = { url: image_url };
|
@@ -1166,26 +1235,38 @@ var TrustMark = class _TrustMark {
|
|
1166 |
image2.tf_source = tf.browser.fromPixels(img).expandDims(0).div(255);
|
1167 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1168 |
tsLog(`Loading: ${time_elapsed}ms`);
|
1169 |
-
resolve(await this.processImage(image2));
|
1170 |
};
|
1171 |
img.src = image2.url;
|
1172 |
}
|
1173 |
if (IS_NODE) {
|
1174 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1175 |
tsLog(`Loading: ${time_elapsed}ms`);
|
1176 |
-
resolve(await this.processImage(image2));
|
1177 |
}
|
1178 |
});
|
1179 |
}
|
1180 |
/**
|
1181 |
* Loads the ONNX models for preprocessing, encoding, and decoding.
|
1182 |
*/
|
1183 |
-
async loadModels() {
|
1184 |
const models = await getModels();
|
1185 |
-
|
1186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1187 |
const session_option = { executionProviders: ["cpu"] };
|
1188 |
-
this.
|
1189 |
throw new Error(`Error loading preprocessing ONNX model: ${error}`);
|
1190 |
});
|
1191 |
this.decoder_session = await ort.InferenceSession.create(decoder_model_url, session_option).catch((error) => {
|
@@ -1333,6 +1414,7 @@ async function hash(content) {
|
|
1333 |
const hashBuffer = await crypto.subtle.digest("SHA-256", content);
|
1334 |
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
1335 |
const hashHex = hashArray.map((bytes) => bytes.toString(16).padStart(2, "0")).join("");
|
|
|
1336 |
return hashHex;
|
1337 |
}
|
1338 |
// Annotate the CommonJS export names for ESM import in node:
|
|
|
870 |
}
|
871 |
}
|
872 |
},
|
873 |
+
{
|
874 |
+
model: "Trustmark variant P encoder",
|
875 |
+
model_name: "encoder_P.onnx",
|
876 |
+
model_remote_host: "https://cc-assets.netlify.app",
|
877 |
+
model_path: "/watermarking/trustmark-models/encoder_P.onnx",
|
878 |
+
onnx_version: "1.9.0",
|
879 |
+
opset_version: 17,
|
880 |
+
metadata: {
|
881 |
+
model_sha: "053441c9c9f05fc158ccba71c610d9d58fcd2c82d1912bf0ffcee988cf2f74c8",
|
882 |
+
model_bytes: 17312208,
|
883 |
+
tags: ["watermarking"],
|
884 |
+
io_ports: {
|
885 |
+
inputs: [
|
886 |
+
{
|
887 |
+
name: " onnx::Concat_0",
|
888 |
+
shape: [1, 3, 256, 256],
|
889 |
+
type: "tensor(float)"
|
890 |
+
},
|
891 |
+
{
|
892 |
+
name: "onnx::Gemm_1",
|
893 |
+
shape: [1, 100],
|
894 |
+
type: "tensor(float)"
|
895 |
+
}
|
896 |
+
],
|
897 |
+
outputs: [
|
898 |
+
{
|
899 |
+
name: "image",
|
900 |
+
shape: [1, 3, 256, 256],
|
901 |
+
type: "tensor(float)"
|
902 |
+
}
|
903 |
+
]
|
904 |
+
}
|
905 |
+
}
|
906 |
+
},
|
907 |
{
|
908 |
model: "Trustmark variant Q decoder",
|
909 |
model_name: "decoder_Q.onnx",
|
|
|
932 |
]
|
933 |
}
|
934 |
}
|
935 |
+
},
|
936 |
+
{
|
937 |
+
model: "Trustmark variant P decoder",
|
938 |
+
model_name: "decoder_P.onnx",
|
939 |
+
model_remote_host: "https://cc-assets.netlify.app",
|
940 |
+
model_path: "/watermarking/trustmark-models/decoder_P.onnx",
|
941 |
+
onnx_version: "1.9.0",
|
942 |
+
opset_version: 17,
|
943 |
+
metadata: {
|
944 |
+
model_sha: "be6d7c33f8a7b376f179e75f3f7c58ff816a9ac7bb6d37fd0a729a635f624c35",
|
945 |
+
model_bytes: 47400467,
|
946 |
+
tags: ["watermarking"],
|
947 |
+
io_ports: {
|
948 |
+
inputs: [
|
949 |
+
{
|
950 |
+
name: "image",
|
951 |
+
shape: [1, 3, 224, 224],
|
952 |
+
type: "tensor(float)"
|
953 |
+
}
|
954 |
+
],
|
955 |
+
outputs: [
|
956 |
+
{
|
957 |
+
name: "output",
|
958 |
+
shape: [1, 100],
|
959 |
+
type: "tensor(float)"
|
960 |
+
}
|
961 |
+
]
|
962 |
+
}
|
963 |
+
}
|
964 |
}
|
965 |
];
|
966 |
|
|
|
989 |
ecc;
|
990 |
decoder_session;
|
991 |
encoder_session;
|
992 |
+
preprocess_224_session;
|
993 |
+
preprocess_256_session;
|
994 |
+
model_type;
|
995 |
/**
|
996 |
* Constructs a new TrustMark instance.
|
997 |
* @param {boolean} [use_ecc=true] - use BCH error correction on the payload, reducing payload size (default)
|
|
|
1011 |
*/
|
1012 |
async decode(image_url) {
|
1013 |
tf.engine().startScope();
|
1014 |
+
const stego_image = await this.loadImage(image_url, "decode");
|
1015 |
await sleep(0);
|
1016 |
tf.engine().endScope();
|
1017 |
const input_feeds = { image: stego_image.onnx };
|
|
|
1056 |
*/
|
1057 |
async encode(image_url, string_secret, wm_strength = 0.4, maculate = false, output = "bytes") {
|
1058 |
tf.engine().startScope();
|
1059 |
+
const cover_image = await this.loadImage(image_url, "encode");
|
1060 |
let mode;
|
1061 |
let secret = new Float32Array(100);
|
1062 |
if (maculate === true) {
|
|
|
1172 |
* @param image The input image data.
|
1173 |
* @returns A promise that resolves with the processed image data or rejects with an error.
|
1174 |
*/
|
1175 |
+
async processImage(image2, process_type) {
|
1176 |
const start_time = /* @__PURE__ */ new Date();
|
1177 |
image2.width = image2.tf_source.shape[2];
|
1178 |
image2.height = image2.tf_source.shape[1];
|
|
|
1206 |
const onnxTensor = new ort.Tensor("float32", data, image2.tf_crop.shape);
|
1207 |
image2.tf_crop = image2.tf_crop.transpose([0, 2, 3, 1]);
|
1208 |
image2.tf_crop = image2.tf_crop.squeeze();
|
1209 |
+
if (this.model_type == "P" && process_type == "decode") {
|
1210 |
+
image2.onnx = (await this.preprocess_224_session.run({ input: onnxTensor })).output;
|
1211 |
+
} else {
|
1212 |
+
image2.onnx = (await this.preprocess_256_session.run({ input: onnxTensor })).output;
|
1213 |
+
}
|
1214 |
await sleep(0);
|
1215 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1216 |
tsLog(`Processing: ${image2.width}x${image2.height}: ${time_elapsed}ms`);
|
|
|
1222 |
* @param image_url The URL of the image to load.
|
1223 |
* @returns A promise that resolves with the processed image data or rejects with an error.
|
1224 |
*/
|
1225 |
+
async loadImage(image_url, process_type) {
|
1226 |
return new Promise(async (resolve) => {
|
1227 |
const start_time = /* @__PURE__ */ new Date();
|
1228 |
const image2 = { url: image_url };
|
|
|
1235 |
image2.tf_source = tf.browser.fromPixels(img).expandDims(0).div(255);
|
1236 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1237 |
tsLog(`Loading: ${time_elapsed}ms`);
|
1238 |
+
resolve(await this.processImage(image2, process_type));
|
1239 |
};
|
1240 |
img.src = image2.url;
|
1241 |
}
|
1242 |
if (IS_NODE) {
|
1243 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1244 |
tsLog(`Loading: ${time_elapsed}ms`);
|
1245 |
+
resolve(await this.processImage(image2, process_type));
|
1246 |
}
|
1247 |
});
|
1248 |
}
|
1249 |
/**
|
1250 |
* Loads the ONNX models for preprocessing, encoding, and decoding.
|
1251 |
*/
|
1252 |
+
async loadModels(type = "Q") {
|
1253 |
const models = await getModels();
|
1254 |
+
let decoder_model_url;
|
1255 |
+
let encoder_model_url;
|
1256 |
+
this.model_type = type;
|
1257 |
+
if (type == "Q") {
|
1258 |
+
decoder_model_url = models["decoder_Q.onnx"];
|
1259 |
+
encoder_model_url = models["encoder_Q.onnx"];
|
1260 |
+
}
|
1261 |
+
if (type == "P") {
|
1262 |
+
decoder_model_url = models["decoder_P.onnx"];
|
1263 |
+
encoder_model_url = models["encoder_P.onnx"];
|
1264 |
+
this.preprocess_224_session = await ort.InferenceSession.create("models/preprocess_224.onnx").catch((error) => {
|
1265 |
+
throw new Error(`Error loading preprocessing ONNX model: ${error}`);
|
1266 |
+
});
|
1267 |
+
}
|
1268 |
const session_option = { executionProviders: ["cpu"] };
|
1269 |
+
this.preprocess_256_session = await ort.InferenceSession.create("models/preprocess_256.onnx").catch((error) => {
|
1270 |
throw new Error(`Error loading preprocessing ONNX model: ${error}`);
|
1271 |
});
|
1272 |
this.decoder_session = await ort.InferenceSession.create(decoder_model_url, session_option).catch((error) => {
|
|
|
1414 |
const hashBuffer = await crypto.subtle.digest("SHA-256", content);
|
1415 |
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
1416 |
const hashHex = hashArray.map((bytes) => bytes.toString(16).padStart(2, "0")).join("");
|
1417 |
+
console.log(hashHex);
|
1418 |
return hashHex;
|
1419 |
}
|
1420 |
// Annotate the CommonJS export names for ESM import in node:
|
dist/index.js
CHANGED
@@ -830,6 +830,40 @@ var ONNX_HUB_MANIFEST_default = [
|
|
830 |
}
|
831 |
}
|
832 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
{
|
834 |
model: "Trustmark variant Q decoder",
|
835 |
model_name: "decoder_Q.onnx",
|
@@ -858,6 +892,35 @@ var ONNX_HUB_MANIFEST_default = [
|
|
858 |
]
|
859 |
}
|
860 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
861 |
}
|
862 |
];
|
863 |
|
@@ -886,7 +949,9 @@ var TrustMark = class _TrustMark {
|
|
886 |
ecc;
|
887 |
decoder_session;
|
888 |
encoder_session;
|
889 |
-
|
|
|
|
|
890 |
/**
|
891 |
* Constructs a new TrustMark instance.
|
892 |
* @param {boolean} [use_ecc=true] - use BCH error correction on the payload, reducing payload size (default)
|
@@ -906,7 +971,7 @@ var TrustMark = class _TrustMark {
|
|
906 |
*/
|
907 |
async decode(image_url) {
|
908 |
tf.engine().startScope();
|
909 |
-
const stego_image = await this.loadImage(image_url);
|
910 |
await sleep(0);
|
911 |
tf.engine().endScope();
|
912 |
const input_feeds = { image: stego_image.onnx };
|
@@ -951,7 +1016,7 @@ var TrustMark = class _TrustMark {
|
|
951 |
*/
|
952 |
async encode(image_url, string_secret, wm_strength = 0.4, maculate = false, output = "bytes") {
|
953 |
tf.engine().startScope();
|
954 |
-
const cover_image = await this.loadImage(image_url);
|
955 |
let mode;
|
956 |
let secret = new Float32Array(100);
|
957 |
if (maculate === true) {
|
@@ -1067,7 +1132,7 @@ var TrustMark = class _TrustMark {
|
|
1067 |
* @param image The input image data.
|
1068 |
* @returns A promise that resolves with the processed image data or rejects with an error.
|
1069 |
*/
|
1070 |
-
async processImage(image2) {
|
1071 |
const start_time = /* @__PURE__ */ new Date();
|
1072 |
image2.width = image2.tf_source.shape[2];
|
1073 |
image2.height = image2.tf_source.shape[1];
|
@@ -1101,7 +1166,11 @@ var TrustMark = class _TrustMark {
|
|
1101 |
const onnxTensor = new ort.Tensor("float32", data, image2.tf_crop.shape);
|
1102 |
image2.tf_crop = image2.tf_crop.transpose([0, 2, 3, 1]);
|
1103 |
image2.tf_crop = image2.tf_crop.squeeze();
|
1104 |
-
|
|
|
|
|
|
|
|
|
1105 |
await sleep(0);
|
1106 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1107 |
tsLog(`Processing: ${image2.width}x${image2.height}: ${time_elapsed}ms`);
|
@@ -1113,7 +1182,7 @@ var TrustMark = class _TrustMark {
|
|
1113 |
* @param image_url The URL of the image to load.
|
1114 |
* @returns A promise that resolves with the processed image data or rejects with an error.
|
1115 |
*/
|
1116 |
-
async loadImage(image_url) {
|
1117 |
return new Promise(async (resolve) => {
|
1118 |
const start_time = /* @__PURE__ */ new Date();
|
1119 |
const image2 = { url: image_url };
|
@@ -1126,26 +1195,38 @@ var TrustMark = class _TrustMark {
|
|
1126 |
image2.tf_source = tf.browser.fromPixels(img).expandDims(0).div(255);
|
1127 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1128 |
tsLog(`Loading: ${time_elapsed}ms`);
|
1129 |
-
resolve(await this.processImage(image2));
|
1130 |
};
|
1131 |
img.src = image2.url;
|
1132 |
}
|
1133 |
if (IS_NODE) {
|
1134 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1135 |
tsLog(`Loading: ${time_elapsed}ms`);
|
1136 |
-
resolve(await this.processImage(image2));
|
1137 |
}
|
1138 |
});
|
1139 |
}
|
1140 |
/**
|
1141 |
* Loads the ONNX models for preprocessing, encoding, and decoding.
|
1142 |
*/
|
1143 |
-
async loadModels() {
|
1144 |
const models = await getModels();
|
1145 |
-
|
1146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1147 |
const session_option = { executionProviders: ["cpu"] };
|
1148 |
-
this.
|
1149 |
throw new Error(`Error loading preprocessing ONNX model: ${error}`);
|
1150 |
});
|
1151 |
this.decoder_session = await ort.InferenceSession.create(decoder_model_url, session_option).catch((error) => {
|
@@ -1293,6 +1374,7 @@ async function hash(content) {
|
|
1293 |
const hashBuffer = await crypto.subtle.digest("SHA-256", content);
|
1294 |
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
1295 |
const hashHex = hashArray.map((bytes) => bytes.toString(16).padStart(2, "0")).join("");
|
|
|
1296 |
return hashHex;
|
1297 |
}
|
1298 |
export {
|
|
|
830 |
}
|
831 |
}
|
832 |
},
|
833 |
+
{
|
834 |
+
model: "Trustmark variant P encoder",
|
835 |
+
model_name: "encoder_P.onnx",
|
836 |
+
model_remote_host: "https://cc-assets.netlify.app",
|
837 |
+
model_path: "/watermarking/trustmark-models/encoder_P.onnx",
|
838 |
+
onnx_version: "1.9.0",
|
839 |
+
opset_version: 17,
|
840 |
+
metadata: {
|
841 |
+
model_sha: "053441c9c9f05fc158ccba71c610d9d58fcd2c82d1912bf0ffcee988cf2f74c8",
|
842 |
+
model_bytes: 17312208,
|
843 |
+
tags: ["watermarking"],
|
844 |
+
io_ports: {
|
845 |
+
inputs: [
|
846 |
+
{
|
847 |
+
name: " onnx::Concat_0",
|
848 |
+
shape: [1, 3, 256, 256],
|
849 |
+
type: "tensor(float)"
|
850 |
+
},
|
851 |
+
{
|
852 |
+
name: "onnx::Gemm_1",
|
853 |
+
shape: [1, 100],
|
854 |
+
type: "tensor(float)"
|
855 |
+
}
|
856 |
+
],
|
857 |
+
outputs: [
|
858 |
+
{
|
859 |
+
name: "image",
|
860 |
+
shape: [1, 3, 256, 256],
|
861 |
+
type: "tensor(float)"
|
862 |
+
}
|
863 |
+
]
|
864 |
+
}
|
865 |
+
}
|
866 |
+
},
|
867 |
{
|
868 |
model: "Trustmark variant Q decoder",
|
869 |
model_name: "decoder_Q.onnx",
|
|
|
892 |
]
|
893 |
}
|
894 |
}
|
895 |
+
},
|
896 |
+
{
|
897 |
+
model: "Trustmark variant P decoder",
|
898 |
+
model_name: "decoder_P.onnx",
|
899 |
+
model_remote_host: "https://cc-assets.netlify.app",
|
900 |
+
model_path: "/watermarking/trustmark-models/decoder_P.onnx",
|
901 |
+
onnx_version: "1.9.0",
|
902 |
+
opset_version: 17,
|
903 |
+
metadata: {
|
904 |
+
model_sha: "be6d7c33f8a7b376f179e75f3f7c58ff816a9ac7bb6d37fd0a729a635f624c35",
|
905 |
+
model_bytes: 47400467,
|
906 |
+
tags: ["watermarking"],
|
907 |
+
io_ports: {
|
908 |
+
inputs: [
|
909 |
+
{
|
910 |
+
name: "image",
|
911 |
+
shape: [1, 3, 224, 224],
|
912 |
+
type: "tensor(float)"
|
913 |
+
}
|
914 |
+
],
|
915 |
+
outputs: [
|
916 |
+
{
|
917 |
+
name: "output",
|
918 |
+
shape: [1, 100],
|
919 |
+
type: "tensor(float)"
|
920 |
+
}
|
921 |
+
]
|
922 |
+
}
|
923 |
+
}
|
924 |
}
|
925 |
];
|
926 |
|
|
|
949 |
ecc;
|
950 |
decoder_session;
|
951 |
encoder_session;
|
952 |
+
preprocess_224_session;
|
953 |
+
preprocess_256_session;
|
954 |
+
model_type;
|
955 |
/**
|
956 |
* Constructs a new TrustMark instance.
|
957 |
* @param {boolean} [use_ecc=true] - use BCH error correction on the payload, reducing payload size (default)
|
|
|
971 |
*/
|
972 |
async decode(image_url) {
|
973 |
tf.engine().startScope();
|
974 |
+
const stego_image = await this.loadImage(image_url, "decode");
|
975 |
await sleep(0);
|
976 |
tf.engine().endScope();
|
977 |
const input_feeds = { image: stego_image.onnx };
|
|
|
1016 |
*/
|
1017 |
async encode(image_url, string_secret, wm_strength = 0.4, maculate = false, output = "bytes") {
|
1018 |
tf.engine().startScope();
|
1019 |
+
const cover_image = await this.loadImage(image_url, "encode");
|
1020 |
let mode;
|
1021 |
let secret = new Float32Array(100);
|
1022 |
if (maculate === true) {
|
|
|
1132 |
* @param image The input image data.
|
1133 |
* @returns A promise that resolves with the processed image data or rejects with an error.
|
1134 |
*/
|
1135 |
+
async processImage(image2, process_type) {
|
1136 |
const start_time = /* @__PURE__ */ new Date();
|
1137 |
image2.width = image2.tf_source.shape[2];
|
1138 |
image2.height = image2.tf_source.shape[1];
|
|
|
1166 |
const onnxTensor = new ort.Tensor("float32", data, image2.tf_crop.shape);
|
1167 |
image2.tf_crop = image2.tf_crop.transpose([0, 2, 3, 1]);
|
1168 |
image2.tf_crop = image2.tf_crop.squeeze();
|
1169 |
+
if (this.model_type == "P" && process_type == "decode") {
|
1170 |
+
image2.onnx = (await this.preprocess_224_session.run({ input: onnxTensor })).output;
|
1171 |
+
} else {
|
1172 |
+
image2.onnx = (await this.preprocess_256_session.run({ input: onnxTensor })).output;
|
1173 |
+
}
|
1174 |
await sleep(0);
|
1175 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1176 |
tsLog(`Processing: ${image2.width}x${image2.height}: ${time_elapsed}ms`);
|
|
|
1182 |
* @param image_url The URL of the image to load.
|
1183 |
* @returns A promise that resolves with the processed image data or rejects with an error.
|
1184 |
*/
|
1185 |
+
async loadImage(image_url, process_type) {
|
1186 |
return new Promise(async (resolve) => {
|
1187 |
const start_time = /* @__PURE__ */ new Date();
|
1188 |
const image2 = { url: image_url };
|
|
|
1195 |
image2.tf_source = tf.browser.fromPixels(img).expandDims(0).div(255);
|
1196 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1197 |
tsLog(`Loading: ${time_elapsed}ms`);
|
1198 |
+
resolve(await this.processImage(image2, process_type));
|
1199 |
};
|
1200 |
img.src = image2.url;
|
1201 |
}
|
1202 |
if (IS_NODE) {
|
1203 |
const time_elapsed = (/* @__PURE__ */ new Date()).getTime() - start_time.getTime();
|
1204 |
tsLog(`Loading: ${time_elapsed}ms`);
|
1205 |
+
resolve(await this.processImage(image2, process_type));
|
1206 |
}
|
1207 |
});
|
1208 |
}
|
1209 |
/**
|
1210 |
* Loads the ONNX models for preprocessing, encoding, and decoding.
|
1211 |
*/
|
1212 |
+
async loadModels(type = "Q") {
|
1213 |
const models = await getModels();
|
1214 |
+
let decoder_model_url;
|
1215 |
+
let encoder_model_url;
|
1216 |
+
this.model_type = type;
|
1217 |
+
if (type == "Q") {
|
1218 |
+
decoder_model_url = models["decoder_Q.onnx"];
|
1219 |
+
encoder_model_url = models["encoder_Q.onnx"];
|
1220 |
+
}
|
1221 |
+
if (type == "P") {
|
1222 |
+
decoder_model_url = models["decoder_P.onnx"];
|
1223 |
+
encoder_model_url = models["encoder_P.onnx"];
|
1224 |
+
this.preprocess_224_session = await ort.InferenceSession.create("models/preprocess_224.onnx").catch((error) => {
|
1225 |
+
throw new Error(`Error loading preprocessing ONNX model: ${error}`);
|
1226 |
+
});
|
1227 |
+
}
|
1228 |
const session_option = { executionProviders: ["cpu"] };
|
1229 |
+
this.preprocess_256_session = await ort.InferenceSession.create("models/preprocess_256.onnx").catch((error) => {
|
1230 |
throw new Error(`Error loading preprocessing ONNX model: ${error}`);
|
1231 |
});
|
1232 |
this.decoder_session = await ort.InferenceSession.create(decoder_model_url, session_option).catch((error) => {
|
|
|
1374 |
const hashBuffer = await crypto.subtle.digest("SHA-256", content);
|
1375 |
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
1376 |
const hashHex = hashArray.map((bytes) => bytes.toString(16).padStart(2, "0")).join("");
|
1377 |
+
console.log(hashHex);
|
1378 |
return hashHex;
|
1379 |
}
|
1380 |
export {
|
docs/assets/hierarchy.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
window.hierarchyData = "
|
|
|
1 |
+
window.hierarchyData = "eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzwMKVNfWAgCbHgqm"
|
docs/assets/main.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
"use strict";
|
2 |
-
window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings.","hierarchy_expand":"Expand","hierarchy_collapse":"Collapse"};
|
3 |
-
"use strict";(()=>{var De=Object.create;var
|
4 |
-
`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r<n;r++){for(var i=this._stack[r],s=[],o=0;o<e.length;o++){var a=i(e[o],o,e);if(!(a==null||a===""))if(Array.isArray(a))for(var l=0;l<a.length;l++)s.push(a[l]);else s.push(a)}e=s}return e},t.Pipeline.prototype.runString=function(e,n){var r=new t.Token(e,n);return this.run([r]).map(function(i){return i.toString()})},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})};t.Vector=function(e){this._magnitude=0,this.elements=e||[]},t.Vector.prototype.positionForIndex=function(e){if(this.elements.length==0)return 0;for(var n=0,r=this.elements.length/2,i=r-n,s=Math.floor(i/2),o=this.elements[s*2];i>1&&(o<e&&(n=s),o>e&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(o<e)return(s+1)*2},t.Vector.prototype.insert=function(e,n){this.upsert(e,n,function(){throw"duplicate index"})},t.Vector.prototype.upsert=function(e,n,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],n):this.elements.splice(i,0,e,n)},t.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,n=this.elements.length,r=1;r<n;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},t.Vector.prototype.dot=function(e){for(var n=0,r=this.elements,i=e.elements,s=r.length,o=i.length,a=0,l=0,c=0,d=0;c<s&&d<o;)a=r[c],l=i[d],a<l?c+=2:a>l?d+=2:a==l&&(n+=r[c+1]*i[d+1],c+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n<this.elements.length;n+=2,r++)e[r]=this.elements[n];return e},t.Vector.prototype.toJSON=function(){return this.elements};t.stemmer=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},r="[^aeiou]",i="[aeiouy]",s=r+"[^aeiouy]*",o=i+"[aeiou]*",a="^("+s+")?"+o+s,l="^("+s+")?"+o+s+"("+o+")?$",c="^("+s+")?"+o+s+o+s,d="^("+s+")?"+i,m=new RegExp(a),f=new RegExp(c),L=new RegExp(l),v=new RegExp(d),w=/^(.+?)(ss|i)es$/,p=/^(.+?)([^s])s$/,y=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,b=/.$/,k=/(at|bl|iz)$/,_=new RegExp("([^aeiouylsz])\\1$"),V=new RegExp("^"+s+i+"[^aeiouwxy]$"),A=/^(.+?[^aeiou])y$/,j=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,q=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,F=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,$=/^(.+?)(s|t)(ion)$/,Q=/^(.+?)e$/,z=/ll$/,W=new RegExp("^"+s+i+"[^aeiouwxy]$"),N=function(u){var g,P,T,h,x,O,R;if(u.length<3)return u;if(T=u.substr(0,1),T=="y"&&(u=T.toUpperCase()+u.substr(1)),h=w,x=p,h.test(u)?u=u.replace(h,"$1$2"):x.test(u)&&(u=u.replace(x,"$1$2")),h=y,x=S,h.test(u)){var E=h.exec(u);h=m,h.test(E[1])&&(h=b,u=u.replace(h,""))}else if(x.test(u)){var E=x.exec(u);g=E[1],x=v,x.test(g)&&(u=g,x=k,O=_,R=V,x.test(u)?u=u+"e":O.test(u)?(h=b,u=u.replace(h,"")):R.test(u)&&(u=u+"e"))}if(h=A,h.test(u)){var E=h.exec(u);g=E[1],u=g+"i"}if(h=j,h.test(u)){var E=h.exec(u);g=E[1],P=E[2],h=m,h.test(g)&&(u=g+e[P])}if(h=q,h.test(u)){var E=h.exec(u);g=E[1],P=E[2],h=m,h.test(g)&&(u=g+n[P])}if(h=F,x=$,h.test(u)){var E=h.exec(u);g=E[1],h=f,h.test(g)&&(u=g)}else if(x.test(u)){var E=x.exec(u);g=E[1]+E[2],x=f,x.test(g)&&(u=g)}if(h=Q,h.test(u)){var E=h.exec(u);g=E[1],h=f,x=L,O=W,(h.test(g)||x.test(g)&&!O.test(g))&&(u=g)}return h=z,x=f,h.test(u)&&x.test(u)&&(h=b,u=u.replace(h,"")),T=="y"&&(u=T.toLowerCase()+u.substr(1)),u};return function(M){return M.update(N)}}(),t.Pipeline.registerFunction(t.stemmer,"stemmer");t.generateStopWordFilter=function(e){var n=e.reduce(function(r,i){return r[i]=i,r},{});return function(r){if(r&&n[r.toString()]!==r.toString())return r}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter");t.trimmer=function(e){return e.update(function(n){return n.replace(/^\W+/,"").replace(/\W+$/,"")})},t.Pipeline.registerFunction(t.trimmer,"trimmer");t.TokenSet=function(){this.final=!1,this.edges={},this.id=t.TokenSet._nextId,t.TokenSet._nextId+=1},t.TokenSet._nextId=1,t.TokenSet.fromArray=function(e){for(var n=new t.TokenSet.Builder,r=0,i=e.length;r<i;r++)n.insert(e[r]);return n.finish(),n.root},t.TokenSet.fromClause=function(e){return"editDistance"in e?t.TokenSet.fromFuzzyString(e.term,e.editDistance):t.TokenSet.fromString(e.term)},t.TokenSet.fromFuzzyString=function(e,n){for(var r=new t.TokenSet,i=[{node:r,editsRemaining:n,str:e}];i.length;){var s=i.pop();if(s.str.length>0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}s.str.length==1&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),f;m in s.node.edges?f=s.node.edges[m]:(f=new t.TokenSet,s.node.edges[m]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i<s;i++){var o=e[i],a=i==s-1;if(o=="*")n.edges[o]=n,n.final=a;else{var l=new t.TokenSet;l.final=a,n.edges[o]=l,n=l}}return r},t.TokenSet.prototype.toArray=function(){for(var e=[],n=[{prefix:"",node:this}];n.length;){var r=n.pop(),i=Object.keys(r.node.edges),s=i.length;r.node.final&&(r.prefix.charAt(0),e.push(r.prefix));for(var o=0;o<s;o++){var a=i[o];n.push({prefix:r.prefix.concat(a),node:r.node.edges[a]})}}return e},t.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",n=Object.keys(this.edges).sort(),r=n.length,i=0;i<r;i++){var s=n[i],o=this.edges[s];e=e+s+o.id}return e},t.TokenSet.prototype.intersect=function(e){for(var n=new t.TokenSet,r=void 0,i=[{qNode:e,output:n,node:this}];i.length;){r=i.pop();for(var s=Object.keys(r.qNode.edges),o=s.length,a=Object.keys(r.node.edges),l=a.length,c=0;c<o;c++)for(var d=s[c],m=0;m<l;m++){var f=a[m];if(f==d||d=="*"){var L=r.node.edges[f],v=r.qNode.edges[d],w=L.final&&v.final,p=void 0;f in r.output.edges?(p=r.output.edges[f],p.final=p.final||w):(p=new t.TokenSet,p.final=w,r.output.edges[f]=p),i.push({qNode:v,output:p,node:L})}}}return n},t.TokenSet.Builder=function(){this.previousWord="",this.root=new t.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},t.TokenSet.Builder.prototype.insert=function(e){var n,r=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<e.length&&i<this.previousWord.length&&e[i]==this.previousWord[i];i++)r++;this.minimize(r),this.uncheckedNodes.length==0?n=this.root:n=this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(var i=r;i<e.length;i++){var s=new t.TokenSet,o=e[i];n.edges[o]=s,this.uncheckedNodes.push({parent:n,char:o,child:s}),n=s}n.final=!0,this.previousWord=e},t.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},t.TokenSet.Builder.prototype.minimize=function(e){for(var n=this.uncheckedNodes.length-1;n>=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l<this.fields.length;l++)i[this.fields[l]]=new t.Vector;e.call(n,n);for(var l=0;l<n.clauses.length;l++){var c=n.clauses[l],d=null,m=t.Set.empty;c.usePipeline?d=this.pipeline.runString(c.term,{fields:c.fields}):d=[c.term];for(var f=0;f<d.length;f++){var L=d[f];c.term=L;var v=t.TokenSet.fromClause(c),w=this.tokenSet.intersect(v).toArray();if(w.length===0&&c.presence===t.Query.presence.REQUIRED){for(var p=0;p<c.fields.length;p++){var y=c.fields[p];o[y]=t.Set.empty}break}for(var S=0;S<w.length;S++)for(var b=w[S],k=this.invertedIndex[b],_=k._index,p=0;p<c.fields.length;p++){var y=c.fields[p],V=k[y],A=Object.keys(V),j=b+"/"+y,q=new t.Set(A);if(c.presence==t.Query.presence.REQUIRED&&(m=m.union(q),o[y]===void 0&&(o[y]=t.Set.complete)),c.presence==t.Query.presence.PROHIBITED){a[y]===void 0&&(a[y]=t.Set.empty),a[y]=a[y].union(q);continue}if(i[y].upsert(_,c.boost,function(Re,He){return Re+He}),!s[j]){for(var F=0;F<A.length;F++){var $=A[F],Q=new t.FieldRef($,y),z=V[$],W;(W=r[Q])===void 0?r[Q]=new t.MatchData(b,y,z):W.add(b,y,z)}s[j]=!0}}}if(c.presence===t.Query.presence.REQUIRED)for(var p=0;p<c.fields.length;p++){var y=c.fields[p];o[y]=o[y].intersect(m)}}for(var N=t.Set.complete,M=t.Set.empty,l=0;l<this.fields.length;l++){var y=this.fields[l];o[y]&&(N=N.intersect(o[y])),a[y]&&(M=M.union(a[y]))}var u=Object.keys(r),g=[],P=Object.create(null);if(n.isNegated()){u=Object.keys(this.fieldVectors);for(var l=0;l<u.length;l++){var Q=u[l],T=t.FieldRef.fromString(Q);r[Q]=new t.MatchData}}for(var l=0;l<u.length;l++){var T=t.FieldRef.fromString(u[l]),h=T.docRef;if(N.contains(h)&&!M.contains(h)){var x=this.fieldVectors[T],O=i[T.fieldName].similarity(x),R;if((R=P[h])!==void 0)R.score+=O,R.matchData.combine(r[T]);else{var E={ref:h,score:O,matchData:r[T]};P[h]=E,g.push(E)}}}return g.sort(function(_e,Me){return Me.score-_e.score})},t.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map(function(r){return[r,this.invertedIndex[r]]},this),n=Object.keys(this.fieldVectors).map(function(r){return[r,this.fieldVectors[r].toJSON()]},this);return{version:t.version,fields:this.fields,fieldVectors:n,invertedIndex:e,pipeline:this.pipeline.toJSON()}},t.Index.load=function(e){var n={},r={},i=e.fieldVectors,s=Object.create(null),o=e.invertedIndex,a=new t.TokenSet.Builder,l=t.Pipeline.load(e.pipeline);e.version!=t.version&&t.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+t.version+"' does not match serialized index '"+e.version+"'");for(var c=0;c<i.length;c++){var d=i[c],m=d[0],f=d[1];r[m]=new t.Vector(f)}for(var c=0;c<o.length;c++){var d=o[c],L=d[0],v=d[1];a.insert(L),s[L]=v}return a.finish(),n.fields=e.fields,n.fieldVectors=r,n.invertedIndex=s,n.tokenSet=a.root,n.pipeline=l,new t.Index(n)};t.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=t.tokenizer,this.pipeline=new t.Pipeline,this.searchPipeline=new t.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},t.Builder.prototype.ref=function(e){this._ref=e},t.Builder.prototype.field=function(e,n){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=n||{}},t.Builder.prototype.b=function(e){e<0?this._b=0:e>1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s<i.length;s++){var o=i[s],a=this._fields[o].extractor,l=a?a(e):e[o],c=this.tokenizer(l,{fields:[o]}),d=this.pipeline.run(c),m=new t.FieldRef(r,o),f=Object.create(null);this.fieldTermFrequencies[m]=f,this.fieldLengths[m]=0,this.fieldLengths[m]+=d.length;for(var L=0;L<d.length;L++){var v=d[L];if(f[v]==null&&(f[v]=0),f[v]+=1,this.invertedIndex[v]==null){var w=Object.create(null);w._index=this.termIndex,this.termIndex+=1;for(var p=0;p<i.length;p++)w[i[p]]=Object.create(null);this.invertedIndex[v]=w}this.invertedIndex[v][o][r]==null&&(this.invertedIndex[v][o][r]=Object.create(null));for(var y=0;y<this.metadataWhitelist.length;y++){var S=this.metadataWhitelist[y],b=v.metadata[S];this.invertedIndex[v][o][r][S]==null&&(this.invertedIndex[v][o][r][S]=[]),this.invertedIndex[v][o][r][S].push(b)}}}},t.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),n=e.length,r={},i={},s=0;s<n;s++){var o=t.FieldRef.fromString(e[s]),a=o.fieldName;i[a]||(i[a]=0),i[a]+=1,r[a]||(r[a]=0),r[a]+=this.fieldLengths[o]}for(var l=Object.keys(this._fields),s=0;s<l.length;s++){var c=l[s];r[c]=r[c]/i[c]}this.averageFieldLength=r},t.Builder.prototype.createFieldVectors=function(){for(var e={},n=Object.keys(this.fieldTermFrequencies),r=n.length,i=Object.create(null),s=0;s<r;s++){for(var o=t.FieldRef.fromString(n[s]),a=o.fieldName,l=this.fieldLengths[o],c=new t.Vector,d=this.fieldTermFrequencies[o],m=Object.keys(d),f=m.length,L=this._fields[a].boost||1,v=this._documents[o.docRef].boost||1,w=0;w<f;w++){var p=m[w],y=d[p],S=this.invertedIndex[p]._index,b,k,_;i[p]===void 0?(b=t.idf(this.invertedIndex[p],this.documentCount),i[p]=b):b=i[p],k=b*((this._k1+1)*y)/(this._k1*(1-this._b+this._b*(l/this.averageFieldLength[a]))+y),k*=L,k*=v,_=Math.round(k*1e3)/1e3,c.insert(S,_)}e[o]=c}this.fieldVectors=e},t.Builder.prototype.createTokenSet=function(){this.tokenSet=t.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},t.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new t.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},t.Builder.prototype.use=function(e){var n=Array.prototype.slice.call(arguments,1);n.unshift(this),e.apply(this,n)},t.MatchData=function(e,n,r){for(var i=Object.create(null),s=Object.keys(r||{}),o=0;o<s.length;o++){var a=s[o];i[a]=r[a].slice()}this.metadata=Object.create(null),e!==void 0&&(this.metadata[e]=Object.create(null),this.metadata[e][n]=i)},t.MatchData.prototype.combine=function(e){for(var n=Object.keys(e.metadata),r=0;r<n.length;r++){var i=n[r],s=Object.keys(e.metadata[i]);this.metadata[i]==null&&(this.metadata[i]=Object.create(null));for(var o=0;o<s.length;o++){var a=s[o],l=Object.keys(e.metadata[i][a]);this.metadata[i][a]==null&&(this.metadata[i][a]=Object.create(null));for(var c=0;c<l.length;c++){var d=l[c];this.metadata[i][a][d]==null?this.metadata[i][a][d]=e.metadata[i][a][d]:this.metadata[i][a][d]=this.metadata[i][a][d].concat(e.metadata[i][a][d])}}}},t.MatchData.prototype.add=function(e,n,r){if(!(e in this.metadata)){this.metadata[e]=Object.create(null),this.metadata[e][n]=r;return}if(!(n in this.metadata[e])){this.metadata[e][n]=r;return}for(var i=Object.keys(r),s=0;s<i.length;s++){var o=i[s];o in this.metadata[e][n]?this.metadata[e][n][o]=this.metadata[e][n][o].concat(r[o]):this.metadata[e][n][o]=r[o]}},t.Query=function(e){this.clauses=[],this.allFields=e},t.Query.wildcard=new String("*"),t.Query.wildcard.NONE=0,t.Query.wildcard.LEADING=1,t.Query.wildcard.TRAILING=2,t.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},t.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=t.Query.wildcard.NONE),e.wildcard&t.Query.wildcard.LEADING&&e.term.charAt(0)!=t.Query.wildcard&&(e.term="*"+e.term),e.wildcard&t.Query.wildcard.TRAILING&&e.term.slice(-1)!=t.Query.wildcard&&(e.term=""+e.term+"*"),"presence"in e||(e.presence=t.Query.presence.OPTIONAL),this.clauses.push(e),this},t.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=t.Query.presence.PROHIBITED)return!1;return!0},t.Query.prototype.term=function(e,n){if(Array.isArray(e))return e.forEach(function(i){this.term(i,t.utils.clone(n))},this),this;var r=n||{};return r.term=e.toString(),this.clause(r),this},t.QueryParseError=function(e,n,r){this.name="QueryParseError",this.message=e,this.start=n,this.end=r},t.QueryParseError.prototype=new Error,t.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},t.QueryLexer.prototype.run=function(){for(var e=t.QueryLexer.lexText;e;)e=e(this)},t.QueryLexer.prototype.sliceString=function(){for(var e=[],n=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],e.push(this.str.slice(n,r)),n=r+1;return e.push(this.str.slice(n,this.pos)),this.escapeCharPositions.length=0,e.join("")},t.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},t.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},t.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos<this.length},t.QueryLexer.EOS="EOS",t.QueryLexer.FIELD="FIELD",t.QueryLexer.TERM="TERM",t.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",t.QueryLexer.BOOST="BOOST",t.QueryLexer.PRESENCE="PRESENCE",t.QueryLexer.lexField=function(e){return e.backup(),e.emit(t.QueryLexer.FIELD),e.ignore(),t.QueryLexer.lexText},t.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ue=="object"?de.exports=n():e.lunr=n()}(this,function(){return t})})()});window.translations||={copy:"Copy",copied:"Copied!",normally_hidden:"This member is normally hidden due to your filter settings.",hierarchy_expand:"Expand",hierarchy_collapse:"Collapse"};var le=[];function J(t,e){le.push({selector:e,constructor:t})}var U=class{alwaysVisibleMember=null;constructor(){this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){le.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!$e(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function $e(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var ce=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var ye=qe(he(),1);async function fe(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=ye.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function ge(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:document.documentElement.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{fe(e,t)}),fe(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{ne(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),ze(t,i,r,e)}function ze(t,e,n,r){n.addEventListener("input",ce(()=>{We(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Ue(e,t):i.key=="ArrowUp"?(pe(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(pe(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),ne(t))})}function ne(t){t.classList.remove("has-focus")}function We(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;o<s.length;o++){let a=s[o],l=r.data.rows[Number(a.ref)],c=1;l.name.toLowerCase().startsWith(i.toLowerCase())&&(c*=1+1/(1+Math.abs(l.name.length-i.length))),a.score*=c}if(s.length===0){let o=document.createElement("li");o.classList.add("no-results");let a=document.createElement("span");a.textContent="No results found",o.appendChild(a),e.appendChild(o)}s.sort((o,a)=>a.score-o.score);for(let o=0,a=Math.min(10,s.length);o<a;o++){let l=r.data.rows[Number(s[o].ref)],c=`<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-${l.kind}"></use></svg>`,d=me(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=`<span class="parent">
|
5 |
-
${
|
6 |
-
`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=C.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){C.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var
|
7 |
/*! Bundled license information:
|
8 |
|
9 |
lunr/lunr.js:
|
|
|
1 |
"use strict";
|
2 |
+
window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings.","hierarchy_expand":"Expand","hierarchy_collapse":"Collapse","folder":"Folder","kind_1":"Project","kind_2":"Module","kind_4":"Namespace","kind_8":"Enumeration","kind_16":"Enumeration Member","kind_32":"Variable","kind_64":"Function","kind_128":"Class","kind_256":"Interface","kind_512":"Constructor","kind_1024":"Property","kind_2048":"Method","kind_4096":"Call Signature","kind_8192":"Index Signature","kind_16384":"Constructor Signature","kind_32768":"Parameter","kind_65536":"Type Literal","kind_131072":"Type Parameter","kind_262144":"Accessor","kind_524288":"Get Signature","kind_1048576":"Set Signature","kind_2097152":"Type Alias","kind_4194304":"Reference","kind_8388608":"Document"};
|
3 |
+
"use strict";(()=>{var De=Object.create;var le=Object.defineProperty;var Fe=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ve=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var qe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var je=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ne(e))!Be.call(t,i)&&i!==n&&le(t,i,{get:()=>e[i],enumerable:!(r=Fe(e,i))||r.enumerable});return t};var $e=(t,e,n)=>(n=t!=null?De(Ve(t)):{},je(e||!t||!t.__esModule?le(n,"default",{value:t,enumerable:!0}):n,t));var pe=qe((de,he)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i<r.length;i++){var s=r[i],o=e[s];if(Array.isArray(o)){n[s]=o.slice();continue}if(typeof o=="string"||typeof o=="number"||typeof o=="boolean"){n[s]=o;continue}throw new TypeError("clone is not deep and does not support nested objects")}return n},t.FieldRef=function(e,n,r){this.docRef=e,this.fieldName=n,this._stringValue=r},t.FieldRef.joiner="/",t.FieldRef.fromString=function(e){var n=e.indexOf(t.FieldRef.joiner);if(n===-1)throw"malformed field ref string";var r=e.slice(0,n),i=e.slice(n+1);return new t.FieldRef(i,r,e)},t.FieldRef.prototype.toString=function(){return this._stringValue==null&&(this._stringValue=this.fieldName+t.FieldRef.joiner+this.docRef),this._stringValue};t.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var n=0;n<this.length;n++)this.elements[e[n]]=!0}else this.length=0},t.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},t.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},t.Set.prototype.contains=function(e){return!!this.elements[e]},t.Set.prototype.intersect=function(e){var n,r,i,s=[];if(e===t.Set.complete)return this;if(e===t.Set.empty)return e;this.length<e.length?(n=this,r=e):(n=e,r=this),i=Object.keys(n.elements);for(var o=0;o<i.length;o++){var a=i[o];a in r.elements&&s.push(a)}return new t.Set(s)},t.Set.prototype.union=function(e){return e===t.Set.complete?t.Set.complete:e===t.Set.empty?this:new t.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},t.idf=function(e,n){var r=0;for(var i in e)i!="_index"&&(r+=Object.keys(e[i]).length);var s=(n-r+.5)/(r+.5);return Math.log(1+Math.abs(s))},t.Token=function(e,n){this.str=e||"",this.metadata=n||{}},t.Token.prototype.toString=function(){return this.str},t.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},t.Token.prototype.clone=function(e){return e=e||function(n){return n},new t.Token(e(this.str,this.metadata),this.metadata)};t.tokenizer=function(e,n){if(e==null||e==null)return[];if(Array.isArray(e))return e.map(function(m){return new t.Token(t.utils.asString(m).toLowerCase(),t.utils.clone(n))});for(var r=e.toString().toLowerCase(),i=r.length,s=[],o=0,a=0;o<=i;o++){var l=r.charAt(o),c=o-a;if(l.match(t.tokenizer.separator)||o==i){if(c>0){var d=t.utils.clone(n)||{};d.position=[a,c],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index.
|
4 |
+
`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r<n;r++){for(var i=this._stack[r],s=[],o=0;o<e.length;o++){var a=i(e[o],o,e);if(!(a==null||a===""))if(Array.isArray(a))for(var l=0;l<a.length;l++)s.push(a[l]);else s.push(a)}e=s}return e},t.Pipeline.prototype.runString=function(e,n){var r=new t.Token(e,n);return this.run([r]).map(function(i){return i.toString()})},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})};t.Vector=function(e){this._magnitude=0,this.elements=e||[]},t.Vector.prototype.positionForIndex=function(e){if(this.elements.length==0)return 0;for(var n=0,r=this.elements.length/2,i=r-n,s=Math.floor(i/2),o=this.elements[s*2];i>1&&(o<e&&(n=s),o>e&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(o<e)return(s+1)*2},t.Vector.prototype.insert=function(e,n){this.upsert(e,n,function(){throw"duplicate index"})},t.Vector.prototype.upsert=function(e,n,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],n):this.elements.splice(i,0,e,n)},t.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,n=this.elements.length,r=1;r<n;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},t.Vector.prototype.dot=function(e){for(var n=0,r=this.elements,i=e.elements,s=r.length,o=i.length,a=0,l=0,c=0,d=0;c<s&&d<o;)a=r[c],l=i[d],a<l?c+=2:a>l?d+=2:a==l&&(n+=r[c+1]*i[d+1],c+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n<this.elements.length;n+=2,r++)e[r]=this.elements[n];return e},t.Vector.prototype.toJSON=function(){return this.elements};t.stemmer=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},r="[^aeiou]",i="[aeiouy]",s=r+"[^aeiouy]*",o=i+"[aeiou]*",a="^("+s+")?"+o+s,l="^("+s+")?"+o+s+"("+o+")?$",c="^("+s+")?"+o+s+o+s,d="^("+s+")?"+i,m=new RegExp(a),p=new RegExp(c),L=new RegExp(l),v=new RegExp(d),b=/^(.+?)(ss|i)es$/,f=/^(.+?)([^s])s$/,y=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,w=/.$/,k=/(at|bl|iz)$/,O=new RegExp("([^aeiouylsz])\\1$"),q=new RegExp("^"+s+i+"[^aeiouwxy]$"),F=/^(.+?[^aeiou])y$/,j=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,$=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,N=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,z=/^(.+?)(s|t)(ion)$/,Q=/^(.+?)e$/,W=/ll$/,U=new RegExp("^"+s+i+"[^aeiouwxy]$"),V=function(u){var g,P,T,h,x,_,R;if(u.length<3)return u;if(T=u.substr(0,1),T=="y"&&(u=T.toUpperCase()+u.substr(1)),h=b,x=f,h.test(u)?u=u.replace(h,"$1$2"):x.test(u)&&(u=u.replace(x,"$1$2")),h=y,x=S,h.test(u)){var E=h.exec(u);h=m,h.test(E[1])&&(h=w,u=u.replace(h,""))}else if(x.test(u)){var E=x.exec(u);g=E[1],x=v,x.test(g)&&(u=g,x=k,_=O,R=q,x.test(u)?u=u+"e":_.test(u)?(h=w,u=u.replace(h,"")):R.test(u)&&(u=u+"e"))}if(h=F,h.test(u)){var E=h.exec(u);g=E[1],u=g+"i"}if(h=j,h.test(u)){var E=h.exec(u);g=E[1],P=E[2],h=m,h.test(g)&&(u=g+e[P])}if(h=$,h.test(u)){var E=h.exec(u);g=E[1],P=E[2],h=m,h.test(g)&&(u=g+n[P])}if(h=N,x=z,h.test(u)){var E=h.exec(u);g=E[1],h=p,h.test(g)&&(u=g)}else if(x.test(u)){var E=x.exec(u);g=E[1]+E[2],x=p,x.test(g)&&(u=g)}if(h=Q,h.test(u)){var E=h.exec(u);g=E[1],h=p,x=L,_=U,(h.test(g)||x.test(g)&&!_.test(g))&&(u=g)}return h=W,x=p,h.test(u)&&x.test(u)&&(h=w,u=u.replace(h,"")),T=="y"&&(u=T.toLowerCase()+u.substr(1)),u};return function(M){return M.update(V)}}(),t.Pipeline.registerFunction(t.stemmer,"stemmer");t.generateStopWordFilter=function(e){var n=e.reduce(function(r,i){return r[i]=i,r},{});return function(r){if(r&&n[r.toString()]!==r.toString())return r}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter");t.trimmer=function(e){return e.update(function(n){return n.replace(/^\W+/,"").replace(/\W+$/,"")})},t.Pipeline.registerFunction(t.trimmer,"trimmer");t.TokenSet=function(){this.final=!1,this.edges={},this.id=t.TokenSet._nextId,t.TokenSet._nextId+=1},t.TokenSet._nextId=1,t.TokenSet.fromArray=function(e){for(var n=new t.TokenSet.Builder,r=0,i=e.length;r<i;r++)n.insert(e[r]);return n.finish(),n.root},t.TokenSet.fromClause=function(e){return"editDistance"in e?t.TokenSet.fromFuzzyString(e.term,e.editDistance):t.TokenSet.fromString(e.term)},t.TokenSet.fromFuzzyString=function(e,n){for(var r=new t.TokenSet,i=[{node:r,editsRemaining:n,str:e}];i.length;){var s=i.pop();if(s.str.length>0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}s.str.length==1&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i<s;i++){var o=e[i],a=i==s-1;if(o=="*")n.edges[o]=n,n.final=a;else{var l=new t.TokenSet;l.final=a,n.edges[o]=l,n=l}}return r},t.TokenSet.prototype.toArray=function(){for(var e=[],n=[{prefix:"",node:this}];n.length;){var r=n.pop(),i=Object.keys(r.node.edges),s=i.length;r.node.final&&(r.prefix.charAt(0),e.push(r.prefix));for(var o=0;o<s;o++){var a=i[o];n.push({prefix:r.prefix.concat(a),node:r.node.edges[a]})}}return e},t.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",n=Object.keys(this.edges).sort(),r=n.length,i=0;i<r;i++){var s=n[i],o=this.edges[s];e=e+s+o.id}return e},t.TokenSet.prototype.intersect=function(e){for(var n=new t.TokenSet,r=void 0,i=[{qNode:e,output:n,node:this}];i.length;){r=i.pop();for(var s=Object.keys(r.qNode.edges),o=s.length,a=Object.keys(r.node.edges),l=a.length,c=0;c<o;c++)for(var d=s[c],m=0;m<l;m++){var p=a[m];if(p==d||d=="*"){var L=r.node.edges[p],v=r.qNode.edges[d],b=L.final&&v.final,f=void 0;p in r.output.edges?(f=r.output.edges[p],f.final=f.final||b):(f=new t.TokenSet,f.final=b,r.output.edges[p]=f),i.push({qNode:v,output:f,node:L})}}}return n},t.TokenSet.Builder=function(){this.previousWord="",this.root=new t.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},t.TokenSet.Builder.prototype.insert=function(e){var n,r=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<e.length&&i<this.previousWord.length&&e[i]==this.previousWord[i];i++)r++;this.minimize(r),this.uncheckedNodes.length==0?n=this.root:n=this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(var i=r;i<e.length;i++){var s=new t.TokenSet,o=e[i];n.edges[o]=s,this.uncheckedNodes.push({parent:n,char:o,child:s}),n=s}n.final=!0,this.previousWord=e},t.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},t.TokenSet.Builder.prototype.minimize=function(e){for(var n=this.uncheckedNodes.length-1;n>=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l<this.fields.length;l++)i[this.fields[l]]=new t.Vector;e.call(n,n);for(var l=0;l<n.clauses.length;l++){var c=n.clauses[l],d=null,m=t.Set.empty;c.usePipeline?d=this.pipeline.runString(c.term,{fields:c.fields}):d=[c.term];for(var p=0;p<d.length;p++){var L=d[p];c.term=L;var v=t.TokenSet.fromClause(c),b=this.tokenSet.intersect(v).toArray();if(b.length===0&&c.presence===t.Query.presence.REQUIRED){for(var f=0;f<c.fields.length;f++){var y=c.fields[f];o[y]=t.Set.empty}break}for(var S=0;S<b.length;S++)for(var w=b[S],k=this.invertedIndex[w],O=k._index,f=0;f<c.fields.length;f++){var y=c.fields[f],q=k[y],F=Object.keys(q),j=w+"/"+y,$=new t.Set(F);if(c.presence==t.Query.presence.REQUIRED&&(m=m.union($),o[y]===void 0&&(o[y]=t.Set.complete)),c.presence==t.Query.presence.PROHIBITED){a[y]===void 0&&(a[y]=t.Set.empty),a[y]=a[y].union($);continue}if(i[y].upsert(O,c.boost,function(Ae,He){return Ae+He}),!s[j]){for(var N=0;N<F.length;N++){var z=F[N],Q=new t.FieldRef(z,y),W=q[z],U;(U=r[Q])===void 0?r[Q]=new t.MatchData(w,y,W):U.add(w,y,W)}s[j]=!0}}}if(c.presence===t.Query.presence.REQUIRED)for(var f=0;f<c.fields.length;f++){var y=c.fields[f];o[y]=o[y].intersect(m)}}for(var V=t.Set.complete,M=t.Set.empty,l=0;l<this.fields.length;l++){var y=this.fields[l];o[y]&&(V=V.intersect(o[y])),a[y]&&(M=M.union(a[y]))}var u=Object.keys(r),g=[],P=Object.create(null);if(n.isNegated()){u=Object.keys(this.fieldVectors);for(var l=0;l<u.length;l++){var Q=u[l],T=t.FieldRef.fromString(Q);r[Q]=new t.MatchData}}for(var l=0;l<u.length;l++){var T=t.FieldRef.fromString(u[l]),h=T.docRef;if(V.contains(h)&&!M.contains(h)){var x=this.fieldVectors[T],_=i[T.fieldName].similarity(x),R;if((R=P[h])!==void 0)R.score+=_,R.matchData.combine(r[T]);else{var E={ref:h,score:_,matchData:r[T]};P[h]=E,g.push(E)}}}return g.sort(function(Me,Re){return Re.score-Me.score})},t.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map(function(r){return[r,this.invertedIndex[r]]},this),n=Object.keys(this.fieldVectors).map(function(r){return[r,this.fieldVectors[r].toJSON()]},this);return{version:t.version,fields:this.fields,fieldVectors:n,invertedIndex:e,pipeline:this.pipeline.toJSON()}},t.Index.load=function(e){var n={},r={},i=e.fieldVectors,s=Object.create(null),o=e.invertedIndex,a=new t.TokenSet.Builder,l=t.Pipeline.load(e.pipeline);e.version!=t.version&&t.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+t.version+"' does not match serialized index '"+e.version+"'");for(var c=0;c<i.length;c++){var d=i[c],m=d[0],p=d[1];r[m]=new t.Vector(p)}for(var c=0;c<o.length;c++){var d=o[c],L=d[0],v=d[1];a.insert(L),s[L]=v}return a.finish(),n.fields=e.fields,n.fieldVectors=r,n.invertedIndex=s,n.tokenSet=a.root,n.pipeline=l,new t.Index(n)};t.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=t.tokenizer,this.pipeline=new t.Pipeline,this.searchPipeline=new t.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},t.Builder.prototype.ref=function(e){this._ref=e},t.Builder.prototype.field=function(e,n){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=n||{}},t.Builder.prototype.b=function(e){e<0?this._b=0:e>1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s<i.length;s++){var o=i[s],a=this._fields[o].extractor,l=a?a(e):e[o],c=this.tokenizer(l,{fields:[o]}),d=this.pipeline.run(c),m=new t.FieldRef(r,o),p=Object.create(null);this.fieldTermFrequencies[m]=p,this.fieldLengths[m]=0,this.fieldLengths[m]+=d.length;for(var L=0;L<d.length;L++){var v=d[L];if(p[v]==null&&(p[v]=0),p[v]+=1,this.invertedIndex[v]==null){var b=Object.create(null);b._index=this.termIndex,this.termIndex+=1;for(var f=0;f<i.length;f++)b[i[f]]=Object.create(null);this.invertedIndex[v]=b}this.invertedIndex[v][o][r]==null&&(this.invertedIndex[v][o][r]=Object.create(null));for(var y=0;y<this.metadataWhitelist.length;y++){var S=this.metadataWhitelist[y],w=v.metadata[S];this.invertedIndex[v][o][r][S]==null&&(this.invertedIndex[v][o][r][S]=[]),this.invertedIndex[v][o][r][S].push(w)}}}},t.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),n=e.length,r={},i={},s=0;s<n;s++){var o=t.FieldRef.fromString(e[s]),a=o.fieldName;i[a]||(i[a]=0),i[a]+=1,r[a]||(r[a]=0),r[a]+=this.fieldLengths[o]}for(var l=Object.keys(this._fields),s=0;s<l.length;s++){var c=l[s];r[c]=r[c]/i[c]}this.averageFieldLength=r},t.Builder.prototype.createFieldVectors=function(){for(var e={},n=Object.keys(this.fieldTermFrequencies),r=n.length,i=Object.create(null),s=0;s<r;s++){for(var o=t.FieldRef.fromString(n[s]),a=o.fieldName,l=this.fieldLengths[o],c=new t.Vector,d=this.fieldTermFrequencies[o],m=Object.keys(d),p=m.length,L=this._fields[a].boost||1,v=this._documents[o.docRef].boost||1,b=0;b<p;b++){var f=m[b],y=d[f],S=this.invertedIndex[f]._index,w,k,O;i[f]===void 0?(w=t.idf(this.invertedIndex[f],this.documentCount),i[f]=w):w=i[f],k=w*((this._k1+1)*y)/(this._k1*(1-this._b+this._b*(l/this.averageFieldLength[a]))+y),k*=L,k*=v,O=Math.round(k*1e3)/1e3,c.insert(S,O)}e[o]=c}this.fieldVectors=e},t.Builder.prototype.createTokenSet=function(){this.tokenSet=t.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},t.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new t.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},t.Builder.prototype.use=function(e){var n=Array.prototype.slice.call(arguments,1);n.unshift(this),e.apply(this,n)},t.MatchData=function(e,n,r){for(var i=Object.create(null),s=Object.keys(r||{}),o=0;o<s.length;o++){var a=s[o];i[a]=r[a].slice()}this.metadata=Object.create(null),e!==void 0&&(this.metadata[e]=Object.create(null),this.metadata[e][n]=i)},t.MatchData.prototype.combine=function(e){for(var n=Object.keys(e.metadata),r=0;r<n.length;r++){var i=n[r],s=Object.keys(e.metadata[i]);this.metadata[i]==null&&(this.metadata[i]=Object.create(null));for(var o=0;o<s.length;o++){var a=s[o],l=Object.keys(e.metadata[i][a]);this.metadata[i][a]==null&&(this.metadata[i][a]=Object.create(null));for(var c=0;c<l.length;c++){var d=l[c];this.metadata[i][a][d]==null?this.metadata[i][a][d]=e.metadata[i][a][d]:this.metadata[i][a][d]=this.metadata[i][a][d].concat(e.metadata[i][a][d])}}}},t.MatchData.prototype.add=function(e,n,r){if(!(e in this.metadata)){this.metadata[e]=Object.create(null),this.metadata[e][n]=r;return}if(!(n in this.metadata[e])){this.metadata[e][n]=r;return}for(var i=Object.keys(r),s=0;s<i.length;s++){var o=i[s];o in this.metadata[e][n]?this.metadata[e][n][o]=this.metadata[e][n][o].concat(r[o]):this.metadata[e][n][o]=r[o]}},t.Query=function(e){this.clauses=[],this.allFields=e},t.Query.wildcard=new String("*"),t.Query.wildcard.NONE=0,t.Query.wildcard.LEADING=1,t.Query.wildcard.TRAILING=2,t.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},t.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=t.Query.wildcard.NONE),e.wildcard&t.Query.wildcard.LEADING&&e.term.charAt(0)!=t.Query.wildcard&&(e.term="*"+e.term),e.wildcard&t.Query.wildcard.TRAILING&&e.term.slice(-1)!=t.Query.wildcard&&(e.term=""+e.term+"*"),"presence"in e||(e.presence=t.Query.presence.OPTIONAL),this.clauses.push(e),this},t.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=t.Query.presence.PROHIBITED)return!1;return!0},t.Query.prototype.term=function(e,n){if(Array.isArray(e))return e.forEach(function(i){this.term(i,t.utils.clone(n))},this),this;var r=n||{};return r.term=e.toString(),this.clause(r),this},t.QueryParseError=function(e,n,r){this.name="QueryParseError",this.message=e,this.start=n,this.end=r},t.QueryParseError.prototype=new Error,t.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},t.QueryLexer.prototype.run=function(){for(var e=t.QueryLexer.lexText;e;)e=e(this)},t.QueryLexer.prototype.sliceString=function(){for(var e=[],n=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],e.push(this.str.slice(n,r)),n=r+1;return e.push(this.str.slice(n,this.pos)),this.escapeCharPositions.length=0,e.join("")},t.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},t.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},t.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos<this.length},t.QueryLexer.EOS="EOS",t.QueryLexer.FIELD="FIELD",t.QueryLexer.TERM="TERM",t.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",t.QueryLexer.BOOST="BOOST",t.QueryLexer.PRESENCE="PRESENCE",t.QueryLexer.lexField=function(e){return e.backup(),e.emit(t.QueryLexer.FIELD),e.ignore(),t.QueryLexer.lexText},t.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof de=="object"?he.exports=n():e.lunr=n()}(this,function(){return t})})()});window.translations||={copy:"Copy",copied:"Copied!",normally_hidden:"This member is normally hidden due to your filter settings.",hierarchy_expand:"Expand",hierarchy_collapse:"Collapse",folder:"Folder",kind_1:"Project",kind_2:"Module",kind_4:"Namespace",kind_8:"Enumeration",kind_16:"Enumeration Member",kind_32:"Variable",kind_64:"Function",kind_128:"Class",kind_256:"Interface",kind_512:"Constructor",kind_1024:"Property",kind_2048:"Method",kind_4096:"Call Signature",kind_8192:"Index Signature",kind_16384:"Constructor Signature",kind_32768:"Parameter",kind_65536:"Type Literal",kind_131072:"Type Parameter",kind_262144:"Accessor",kind_524288:"Get Signature",kind_1048576:"Set Signature",kind_2097152:"Type Alias",kind_4194304:"Reference",kind_8388608:"Document"};var ce=[];function G(t,e){ce.push({selector:e,constructor:t})}var J=class{alwaysVisibleMember=null;constructor(){this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){ce.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!ze(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function ze(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var ue=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var ge=$e(pe(),1);async function A(t){let e=Uint8Array.from(atob(t),s=>s.charCodeAt(0)),r=new Blob([e]).stream().pipeThrough(new DecompressionStream("deflate")),i=await new Response(r).text();return JSON.parse(i)}async function fe(t,e){if(!window.searchData)return;let n=await A(window.searchData);t.data=n,t.index=ge.Index.load(n.index),e.classList.remove("loading"),e.classList.add("ready")}function ve(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:document.documentElement.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{fe(e,t)}),fe(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{re(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),We(t,i,r,e)}function We(t,e,n,r){n.addEventListener("input",ue(()=>{Ue(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Je(e,t):i.key=="ArrowUp"?(me(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(me(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),re(t))})}function re(t){t.classList.remove("has-focus")}function Ue(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;o<s.length;o++){let a=s[o],l=r.data.rows[Number(a.ref)],c=1;l.name.toLowerCase().startsWith(i.toLowerCase())&&(c*=1+1/(1+Math.abs(l.name.length-i.length))),a.score*=c}if(s.length===0){let o=document.createElement("li");o.classList.add("no-results");let a=document.createElement("span");a.textContent="No results found",o.appendChild(a),e.appendChild(o)}s.sort((o,a)=>a.score-o.score);for(let o=0,a=Math.min(10,s.length);o<a;o++){let l=r.data.rows[Number(s[o].ref)],c=`<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-${l.kind}"></use></svg>`,d=ye(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=`<span class="parent">
|
5 |
+
${ye(l.parent,i)}.</span>${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=c+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function me(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Je(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),re(e)}}function ye(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ne(t.substring(s,o)),`<b>${ne(t.substring(o,o+r.length))}</b>`),s=o+r.length,o=n.indexOf(r,s);return i.push(ne(t.substring(s))),i.join("")}var Ge={"&":"&","<":"<",">":">","'":"'",'"':"""};function ne(t){return t.replace(/[&<>"'"]/g,e=>Ge[e])}var I=class{el;app;constructor(e){this.el=e.el,this.app=e.app}};var H="mousedown",Ee="mousemove",B="mouseup",X={x:0,y:0},xe=!1,ie=!1,Xe=!1,D=!1,be=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(be?"is-mobile":"not-mobile");be&&"ontouchstart"in document.documentElement&&(Xe=!0,H="touchstart",Ee="touchmove",B="touchend");document.addEventListener(H,t=>{ie=!0,D=!1;let e=H=="touchstart"?t.targetTouches[0]:t;X.y=e.pageY||0,X.x=e.pageX||0});document.addEventListener(Ee,t=>{if(ie&&!D){let e=H=="touchstart"?t.targetTouches[0]:t,n=X.x-(e.pageX||0),r=X.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ie=!1});document.addEventListener("click",t=>{xe&&(t.preventDefault(),t.stopImmediatePropagation(),xe=!1)});var Y=class extends I{active;className;constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(H,n=>this.onDocumentPointerDown(n)),document.addEventListener(B,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var se;try{se=localStorage}catch{se={getItem(){return null},setItem(){}}}var C=se;var Le=document.head.appendChild(document.createElement("style"));Le.dataset.for="filters";var Z=class extends I{key;value;constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),Le.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; }
|
6 |
+
`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=C.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){C.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var oe=new Map,ae=class{open;accordions=[];key;constructor(e,n){this.key=e,this.open=n}add(e){this.accordions.push(e),e.open=this.open,e.addEventListener("toggle",()=>{this.toggle(e.open)})}toggle(e){for(let n of this.accordions)n.open=e;C.setItem(this.key,e.toString())}},K=class extends I{constructor(e){super(e);let n=this.el.querySelector("summary"),r=n.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)});let i=`tsd-accordion-${n.dataset.key??n.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`,s;if(oe.has(i))s=oe.get(i);else{let o=C.getItem(i),a=o?o==="true":this.el.open;s=new ae(i,a),oe.set(i,s)}s.add(this.el)}};function Se(t){let e=C.getItem("tsd-theme")||"os";t.value=e,we(e),t.addEventListener("change",()=>{C.setItem("tsd-theme",t.value),we(t.value)})}function we(t){document.documentElement.dataset.theme=t}var ee;function Ce(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Te),Te())}async function Te(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let e=await A(window.navigationData);ee=document.documentElement.dataset.base,ee.endsWith("/")||(ee+="/"),t.innerHTML="";for(let n of e)Ie(n,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Ie(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='<svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>',ke(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let c of t.children)Ie(c,l,i)}else ke(t,r,t.class)}function ke(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));if(r.href=ee+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&r.classList.add("current"),t.kind){let i=window.translations[`kind_${t.kind}`].replaceAll('"',""");r.innerHTML=`<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon" aria-label="${i}"><use href="#icon-${t.kind}"></use></svg>`}r.appendChild(document.createElement("span")).textContent=t.text}else{let r=e.appendChild(document.createElement("span")),i=window.translations.folder.replaceAll('"',""");r.innerHTML=`<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon" aria-label="${i}"><use href="#icon-folder"></use></svg>`,r.appendChild(document.createElement("span")).textContent=t.text}}var te=document.documentElement.dataset.base;te.endsWith("/")||(te+="/");function Pe(){document.querySelector(".tsd-full-hierarchy")?Ye():document.querySelector(".tsd-hierarchy")&&Ze()}function Ye(){document.addEventListener("click",r=>{let i=r.target;for(;i.parentElement&&i.parentElement.tagName!="LI";)i=i.parentElement;i.dataset.dropdown&&(i.dataset.dropdown=String(i.dataset.dropdown!=="true"))});let t=new Map,e=new Set;for(let r of document.querySelectorAll(".tsd-full-hierarchy [data-refl]")){let i=r.querySelector("ul");t.has(r.dataset.refl)?e.add(r.dataset.refl):i&&t.set(r.dataset.refl,i)}for(let r of e)n(r);function n(r){let i=t.get(r).cloneNode(!0);i.querySelectorAll("[id]").forEach(s=>{s.removeAttribute("id")}),i.querySelectorAll("[data-dropdown]").forEach(s=>{s.dataset.dropdown="false"});for(let s of document.querySelectorAll(`[data-refl="${r}"]`)){let o=tt(),a=s.querySelector("ul");s.insertBefore(o,a),o.dataset.dropdown=String(!!a),a||s.appendChild(i.cloneNode(!0))}}}function Ze(){let t=document.getElementById("tsd-hierarchy-script");t&&(t.addEventListener("load",Qe),Qe())}async function Qe(){let t=document.querySelector(".tsd-panel.tsd-hierarchy:has(h4 a)");if(!t||!window.hierarchyData)return;let e=+t.dataset.refl,n=await A(window.hierarchyData),r=t.querySelector("ul"),i=document.createElement("ul");if(i.classList.add("tsd-hierarchy"),Ke(i,n,e),r.querySelectorAll("li").length==i.querySelectorAll("li").length)return;let s=document.createElement("span");s.classList.add("tsd-hierarchy-toggle"),s.textContent=window.translations.hierarchy_expand,t.querySelector("h4 a")?.insertAdjacentElement("afterend",s),s.insertAdjacentText("beforebegin",", "),s.addEventListener("click",()=>{s.textContent===window.translations.hierarchy_expand?(r.insertAdjacentElement("afterend",i),r.remove(),s.textContent=window.translations.hierarchy_collapse):(i.insertAdjacentElement("afterend",r),i.remove(),s.textContent=window.translations.hierarchy_expand)})}function Ke(t,e,n){let r=e.roots.filter(i=>et(e,i,n));for(let i of r)t.appendChild(_e(e,i,n))}function _e(t,e,n,r=new Set){if(r.has(e))return;r.add(e);let i=t.reflections[e],s=document.createElement("li");if(s.classList.add("tsd-hierarchy-item"),e===n){let o=s.appendChild(document.createElement("span"));o.textContent=i.name,o.classList.add("tsd-hierarchy-target")}else{for(let a of i.uniqueNameParents||[]){let l=t.reflections[a],c=s.appendChild(document.createElement("a"));c.textContent=l.name,c.href=te+l.url,c.className=l.class+" tsd-signature-type",s.append(document.createTextNode("."))}let o=s.appendChild(document.createElement("a"));o.textContent=t.reflections[e].name,o.href=te+i.url,o.className=i.class+" tsd-signature-type"}if(i.children){let o=s.appendChild(document.createElement("ul"));o.classList.add("tsd-hierarchy");for(let a of i.children){let l=_e(t,a,n,r);l&&o.appendChild(l)}}return r.delete(e),s}function et(t,e,n){if(e===n)return!0;let r=new Set,i=[t.reflections[e]];for(;i.length;){let s=i.pop();if(!r.has(s)){r.add(s);for(let o of s.children||[]){if(o===n)return!0;i.push(t.reflections[o])}}}return!1}function tt(){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("width","20"),t.setAttribute("height","20"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.innerHTML='<use href="#icon-chevronDown"></use>',t}G(Y,"a[data-toggle]");G(K,".tsd-accordion");G(Z,".tsd-filter-item input[type=checkbox]");var Oe=document.getElementById("tsd-theme");Oe&&Se(Oe);var nt=new J;Object.defineProperty(window,"app",{value:nt});ve();Ce();Pe();})();
|
7 |
/*! Bundled license information:
|
8 |
|
9 |
lunr/lunr.js:
|
docs/assets/navigation.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
window.navigationData = "
|
|
|
1 |
+
window.navigationData = "eJyNkTELwjAUhP9L5qJYRKSjdXDQSXEpHZ5pNMWkLckrWKT/3Yg2aUiHjsndfRz3sjdB9kKSkBvljFISkQaQm7esi1Ywvfz9LzhKYcRnWRUkiSNCeSkKxSqSZBaxSw8uTwVo7fJG8xmreNvnfWTDBSAI6JgKK1hpVou9cR990NDFgawpLOUqPRieTXsJKTRAS+wc8d5WFMu6GjMDu8/erKfQV6a04cwk/90BeDwkqlajBPUMh7TSrCEvX/fJAw1DOpA1TV03/wATHdCC"
|
docs/assets/search.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
window.searchData = "
|
|
|
1 |
+
window.searchData = "eJytm11v48YOhv+LemukmS/byV03LdAFToGDdtGbIDAUeZoVVrZcW243CPLfO6MPizSpmLJ9lciel6RGDzmURn5LtuW/u+T+8S35lq+Xyb2eJOt05ZP7pNrud9Uq3X5LJsl+W4RPVuVyX/jdj4dvbr5WqyJ8nRXpbueDmSR5n3SWlJ4fbH2Jit+grVYCbB3GMFYnySbd+nWFwgKubrU9+PLrrFzm6xexqx+A4oTPXgm8O9VPWlaud2F0VpVbuX8sOicENAH7nV/4LJP77wUX+975bOurReHXcvdIc3EEo878Sme99AEgv10EI7u8HHHqVHj5+a/PjIUKL45ls/WbbZkFgwut7fiQBvVXjcxNL4sM6S+OLBRZXyyq142XR4M050Sgb+38iOaxEF/Dc4PgWGSv4bm9mJ9X6csI/60qb1UXR1GU6XJkCFFyVf+/RZZ24wJYdZqzIujBS6u0SF99v3R2Hcfhmw87jmmfRS+++iP76lfpQ7pJs7x6PZj8a7/OqpCr0CgZ/XEL0sf5se8//RZVlQ9dt4PHe4Z91s/h+/+hGeyuX+/xMGa8K2mnM+RM1Okw4sEqnr5G/Nh2YzAGLLo4hq55XKy40jUYxbHs4jj+afh5ziuavINRYNHFMTxnXxdtGyGPAYuuEkPbVo2YiCPVOVGgSvq8z4vlp4dfR0QQFSGMa3hvpvOL/16NBNJXjeZKEXzK1+n2dWwMz53qSlH8P82++dEzselUV4rip12W52ODSFvRWTHAlIB3Rd2i2nwsvofnaG5NhK8+XkzaCMavJEcORAtIrxmqEb88POyqtKLl+thdOOgGjvAl6WmJp49b2dN+Brr2Yz8nmvXTfkLD8ntZMovMsacwcNsOvMDXL1n2iVvSGG/h+MOFTOzvtfJih+3Ycz3WVf/hNSty+tTi2GM9NuvGnn2Oi0357+mza0ed72X395bWXOqmHXa+n6KkT/qom2bU+V5W+0LgpRl1vpdl/o/ASzPqXC+h+p/00Yy5wANtxxkXw+23pNqdvurNmHM9ZD4vys3pBakbdsGZfMpfPq9PJ0sY+Zy/5OtL8iWsn6Hnr2JJ/VIK/baaWFur8loR/FQUMIjT9bbVpUUBA7mk9nZzEUv46MmIoivMRhX8rv+ottx+xbHr6C52Px/tVJz2uN6vnv02nm/ssoWuG1EdQBBdHENV1t2w+LzrNvgKXn/138U+v/rvIzw+TZLg0H9P7t+6O/EwQt+Ym7sg+Sv3xTLusjWhBIPlauVrcJZltq//fWqH/eljcxsHN6N/vE0mj7cTo25mc/X0NHnsxPUX9Qedjf6TWqiGhIoIFRLqcKQmZnozn98hoSZCjYQmHOmJnt9YNUVCQ4QGCW04MpxHS4QWCV04spzQEaFDwmk4cpxwSoRTJJyFoyknnBHhDAnn4WjGCedEOEfCQNDjnBPeEeEdBiDycMcpFWVHHcETkVC3rJjhBwOkaoIUyx5lSGGIVEQj3B5yYsqRwiCpiIdiUVKUJYVhUhERxeKkKE8KA6UiJopFSlGmFIZKRVTUlD1nypXCYKmIi2LRUpQtheFSERnF4qUoXwoDpm8Hw9aUMI0J02qoWmgKmD6qUDVgLNqaKVIYMF2XKRZtTQHTGDAdkdF8daSAaQyYjshozYopYBoDpiMymkVbU8A0BkxHZDSLtqaAaQyYjshoFm1NAdMYMB2R0WzF1BQwjQEzERnNom0oYAYDZmrAWLQNJcxgwkxkRrOEGUqYOVoHIzOGJcwwSyEmzNjBVZQCZjBgJiJjWDoNBcxgwMx0sPAaCpjBgJnZYMk3FDCDATMRGcPmhaGAGQyYicgYNi8MBcxgwGxExrB5YSlgFgNmIzKGzQtLAbMYMBuRMWxeWAqYxYDZGjA2LywFzB41W3W3xeaFZfotTJitCWPzwlLCLCbMRmYsmxeWEmYxYTYyY1m2LSXMYsJsZMayhFlKmMWE2ciM5ftTSpjFhLnIjOV7VEqYw4S5yIxlCXOUMIcJc5EZyxLmKGEOE+YiM5YlzFHCHCbMRWYsS5ijhLmjlr7u6VnCHNPVY8Jc3dezhDlKmMOEuciMYwlzlDCHCXORGccS5ihh7Uf1bWN8nuCXn5vbx3DXV28CviWL9oYyrCPtHexbEpaK+7f39/4GMhyBe8j4XXSDdzN7U6F7OJgKDYLU1GF3FljSwJKTWqp3oYCRO3BmWmbksEsKzFgQy0xupnuUDqba9ZZCuZZY6p7/9UYsCCeks8gI3NUCJwamp1Fq1fwNy77QLv/MDEQ7A9HK6GKfBwKLU2BRdlX5h2rA5ByYlJ06eJeot6NAaGrWTqnsEnX7ZsCYAsZ0e11k+JHXPnurIEKprRc0VSDFw0oktMBMOUgFJ0uFo+wGBmSlpt9sBRkJJtnI6ky3kwquFEgk1WaSEcYEt+FBZgIgjXB20LsNwBS44lp2wfALCsAUyGUjw5q89NtbA8bmI2w1b5CAoAAHeoSh+skruIbAyigj7QtWICCwnmpZxWv33EB2ABtWRlK7BwnQBgxZWVFrdxiBDbCCWll6tDu7wAYA0Mrmttu2BUYALVY4qWDHHhgC9cvI0gHtxANLYB22smzoX1kAZuAqLOM3mNnV73Rmh5dPAchgptRIe93OAjQHKFKy+QKvDAM7YLaUjCT45i8wBPJdyVKj3m4GyQVy3coWQfgCPAgFZKmSVelmWxrEAq6+lV0tfq8MrIsgKiebIPTKKjg/kP1alrlDv6jojQKeZDgN/RSiNwnCVLJExC/WgzMG1UHJaib8dRG4ruAaiMwcbUKCywlodTJa0UYuiAnMk5NGBbYpQUyAWiejFvzar7cDSL1tdLIsOvygDJRRkEciG+jVZLB6w0ZAYCncYW/yjS/ydZA8Pr2//weQ4nw4";
|
docs/assets/style.css
CHANGED
@@ -29,9 +29,9 @@
|
|
29 |
--light-color-ts-function: #572be7;
|
30 |
--light-color-ts-class: #1f70c2;
|
31 |
--light-color-ts-interface: #108024;
|
32 |
-
--light-color-ts-constructor:
|
33 |
-
--light-color-ts-property: #
|
34 |
-
--light-color-ts-method: #
|
35 |
--light-color-ts-reference: #ff4d82;
|
36 |
--light-color-ts-call-signature: var(--light-color-ts-method);
|
37 |
--light-color-ts-index-signature: var(--light-color-ts-property);
|
@@ -41,7 +41,7 @@
|
|
41 |
--light-color-ts-parameter: var(--light-color-ts-variable);
|
42 |
/* type literal not included as links will never be generated to it */
|
43 |
--light-color-ts-type-parameter: #a55c0e;
|
44 |
-
--light-color-ts-accessor: #
|
45 |
--light-color-ts-get-signature: var(--light-color-ts-accessor);
|
46 |
--light-color-ts-set-signature: var(--light-color-ts-accessor);
|
47 |
--light-color-ts-type-alias: #d51270;
|
@@ -86,7 +86,7 @@
|
|
86 |
--dark-color-ts-function: #a280ff;
|
87 |
--dark-color-ts-class: #8ac4ff;
|
88 |
--dark-color-ts-interface: #6cff87;
|
89 |
-
--dark-color-ts-constructor:
|
90 |
--dark-color-ts-property: #ff984d;
|
91 |
--dark-color-ts-method: #ff4db8;
|
92 |
--dark-color-ts-reference: #ff4d82;
|
@@ -96,7 +96,7 @@
|
|
96 |
--dark-color-ts-parameter: var(--dark-color-ts-variable);
|
97 |
/* type literal not included as links will never be generated to it */
|
98 |
--dark-color-ts-type-parameter: #e07d13;
|
99 |
-
--dark-color-ts-accessor: #
|
100 |
--dark-color-ts-get-signature: var(--dark-color-ts-accessor);
|
101 |
--dark-color-ts-set-signature: var(--dark-color-ts-accessor);
|
102 |
--dark-color-ts-type-alias: #ff6492;
|
@@ -991,14 +991,15 @@
|
|
991 |
vertical-align: text-top;
|
992 |
}
|
993 |
/*
|
994 |
-
|
995 |
-
|
996 |
-
*/
|
997 |
.tsd-accordion:not([open]) > .tsd-accordion-summary > svg:first-child,
|
998 |
.tsd-accordion:not([open]) > .tsd-accordion-summary > h1 > svg:first-child,
|
999 |
.tsd-accordion:not([open]) > .tsd-accordion-summary > h2 > svg:first-child,
|
1000 |
.tsd-accordion:not([open]) > .tsd-accordion-summary > h3 > svg:first-child,
|
1001 |
-
.tsd-accordion:not([open]) > .tsd-accordion-summary > h4 > svg:first-child
|
|
|
1002 |
transform: rotate(-90deg);
|
1003 |
}
|
1004 |
.tsd-index-content > :not(:first-child) {
|
|
|
29 |
--light-color-ts-function: #572be7;
|
30 |
--light-color-ts-class: #1f70c2;
|
31 |
--light-color-ts-interface: #108024;
|
32 |
+
--light-color-ts-constructor: var(--light-color-ts-class);
|
33 |
+
--light-color-ts-property: #9f5f30;
|
34 |
+
--light-color-ts-method: #be3989;
|
35 |
--light-color-ts-reference: #ff4d82;
|
36 |
--light-color-ts-call-signature: var(--light-color-ts-method);
|
37 |
--light-color-ts-index-signature: var(--light-color-ts-property);
|
|
|
41 |
--light-color-ts-parameter: var(--light-color-ts-variable);
|
42 |
/* type literal not included as links will never be generated to it */
|
43 |
--light-color-ts-type-parameter: #a55c0e;
|
44 |
+
--light-color-ts-accessor: #c73c3c;
|
45 |
--light-color-ts-get-signature: var(--light-color-ts-accessor);
|
46 |
--light-color-ts-set-signature: var(--light-color-ts-accessor);
|
47 |
--light-color-ts-type-alias: #d51270;
|
|
|
86 |
--dark-color-ts-function: #a280ff;
|
87 |
--dark-color-ts-class: #8ac4ff;
|
88 |
--dark-color-ts-interface: #6cff87;
|
89 |
+
--dark-color-ts-constructor: var(--dark-color-ts-class);
|
90 |
--dark-color-ts-property: #ff984d;
|
91 |
--dark-color-ts-method: #ff4db8;
|
92 |
--dark-color-ts-reference: #ff4d82;
|
|
|
96 |
--dark-color-ts-parameter: var(--dark-color-ts-variable);
|
97 |
/* type literal not included as links will never be generated to it */
|
98 |
--dark-color-ts-type-parameter: #e07d13;
|
99 |
+
--dark-color-ts-accessor: #ff6060;
|
100 |
--dark-color-ts-get-signature: var(--dark-color-ts-accessor);
|
101 |
--dark-color-ts-set-signature: var(--dark-color-ts-accessor);
|
102 |
--dark-color-ts-type-alias: #ff6492;
|
|
|
991 |
vertical-align: text-top;
|
992 |
}
|
993 |
/*
|
994 |
+
* We need to be careful to target the arrow indicating whether the accordion
|
995 |
+
* is open, but not any other SVGs included in the details element.
|
996 |
+
*/
|
997 |
.tsd-accordion:not([open]) > .tsd-accordion-summary > svg:first-child,
|
998 |
.tsd-accordion:not([open]) > .tsd-accordion-summary > h1 > svg:first-child,
|
999 |
.tsd-accordion:not([open]) > .tsd-accordion-summary > h2 > svg:first-child,
|
1000 |
.tsd-accordion:not([open]) > .tsd-accordion-summary > h3 > svg:first-child,
|
1001 |
+
.tsd-accordion:not([open]) > .tsd-accordion-summary > h4 > svg:first-child,
|
1002 |
+
.tsd-accordion:not([open]) > .tsd-accordion-summary > h5 > svg:first-child {
|
1003 |
transform: rotate(-90deg);
|
1004 |
}
|
1005 |
.tsd-index-content > :not(:first-child) {
|
docs/classes/bchecc.BCH.html
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
docs/classes/datalayer.DataLayer.html
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DataLayer | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="../modules/datalayer.html">datalayer</a></li><li><a href="datalayer.DataLayer.html">DataLayer</a></li></ul><h1>Class DataLayer</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Data layer for encoding and decoding payloads class.
|
2 |
This class utilizes BCH codes for error correction.</p>
|
3 |
-
</div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:20</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="datalayer.DataLayer.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
4 |
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="datalayer.DataLayer.html#bch_decoders" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bch_<wbr/>decoders</span></a>
|
5 |
-
<a href="datalayer.DataLayer.html#bch_encoder" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bch_<wbr/>encoder</span></a>
|
6 |
-
<a href="datalayer.DataLayer.html#encoding_mode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoding_<wbr/>mode</span></a>
|
7 |
-
<a href="datalayer.DataLayer.html#payload_len" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>payload_<wbr/>len</span></a>
|
8 |
-
<a href="datalayer.DataLayer.html#versionbits" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>versionbits</span></a>
|
9 |
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="datalayer.DataLayer.html#buildbch" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>buildBCH</span></a>
|
10 |
-
<a href="datalayer.DataLayer.html#encodeascii" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Ascii</span></a>
|
11 |
-
<a href="datalayer.DataLayer.html#encodebinary" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Binary</span></a>
|
12 |
-
<a href="datalayer.DataLayer.html#encodepacket" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Packet</span></a>
|
13 |
-
<a href="datalayer.DataLayer.html#encodetext" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Text</span></a>
|
14 |
-
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructordatalayer" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">DataLayer</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">payload_len</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">verbose</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">encoding_mode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="datalayer.DataLayer.html" class="tsd-signature-type tsd-kind-class">DataLayer</a><a href="#constructordatalayer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></
|
15 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">payload_len</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The length of the payload in bits.</p>
|
16 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">verbose</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Flag to indicate if messages should be logged.</p>
|
17 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">encoding_mode</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The encoding mode to be used (default is 0).</p>
|
18 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="datalayer.DataLayer.html" class="tsd-signature-type tsd-kind-class">DataLayer</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:33</li></ul></aside></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="bch_decoders" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>bch_<wbr/>decoders</span><a href="#bch_decoders" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bch_decoders</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <a href="bchecc.BCH.html" class="tsd-signature-type tsd-kind-class">BCH</a><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:25</li></ul></aside></section><section class="tsd-panel tsd-member"><a id="bch_encoder" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>bch_<wbr/>encoder</span><a href="#bch_encoder" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bch_encoder</span><span class="tsd-signature-symbol">:</span> <a href="bchecc.BCH.html" class="tsd-signature-type tsd-kind-class">BCH</a></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:24</li></ul></aside></section><section class="tsd-panel tsd-member"><a id="encoding_mode" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encoding_<wbr/>mode</span><a href="#encoding_mode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">encoding_mode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:22</li></ul></aside></section><section class="tsd-panel tsd-member"><a id="payload_len" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>payload_<wbr/>len</span><a href="#payload_len" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">payload_len</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:21</li></ul></aside></section><section class="tsd-panel tsd-member"><a id="versionbits" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>versionbits</span><a href="#versionbits" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">versionbits</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:23</li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="buildbch" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>buildBCH</span><a href="#buildbch" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="buildbch-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">buildBCH</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">encoding_mode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="bchecc.BCH.html" class="tsd-signature-type tsd-kind-class">BCH</a><a href="#buildbch-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></
|
19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">encoding_mode</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The encoding mode.</p>
|
20 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="bchecc.BCH.html" class="tsd-signature-type tsd-kind-class">BCH</a></h4><p>A BCH instance configured for the specified encoding mode.</p>
|
21 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:54</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="encodeascii" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode<wbr/>Ascii</span><a href="#encodeascii" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="encodeascii-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encodeAscii</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">text</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Float32Array</span><
|
22 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">text</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The input text string.</p>
|
23 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Float32Array</span
|
24 |
<li>The encoded Float32Array.</li>
|
25 |
</ul>
|
26 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:148</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="encodebinary" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode<wbr/>Binary</span><a href="#encodebinary" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="encodebinary-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encodeBinary</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">strbin</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Float32Array</span><
|
27 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">strbin</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The input binary string.</p>
|
28 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Float32Array</span
|
29 |
<li>The encoded Float32Array with the ECC encoding.</li>
|
30 |
</ul>
|
31 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:89</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="encodepacket" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode<wbr/>Packet</span><a href="#encodepacket" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="encodepacket-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encodePacket</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">packet_d</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Float32Array</span><
|
32 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">packet_d</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The binary string representation of the packet data.</p>
|
33 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Float32Array</span
|
34 |
<li>The encoded Float32Array.</li>
|
35 |
</ul>
|
36 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:99</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="encodetext" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode<wbr/>Text</span><a href="#encodetext" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="encodetext-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encodeText</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">text</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Float32Array</span><
|
37 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">text</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The input text string.</p>
|
38 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Float32Array</span
|
39 |
<li>The encoded Float32Array.</li>
|
40 |
</ul>
|
41 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:72</li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#bch_decoders" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bch_<wbr/>decoders</span></a><a href="#bch_encoder" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bch_<wbr/>encoder</span></a><a href="#encoding_mode" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoding_<wbr/>mode</span></a><a href="#payload_len" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>payload_<wbr/>len</span></a><a href="#versionbits" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>versionbits</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#buildbch" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>buildBCH</span></a><a href="#encodeascii" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Ascii</span></a><a href="#encodebinary" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Binary</span></a><a href="#encodepacket" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Packet</span></a><a href="#encodetext" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Text</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DataLayer | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="../modules/datalayer.html">datalayer</a></li><li><a href="datalayer.DataLayer.html">DataLayer</a></li></ul><h1>Class DataLayer</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Data layer for encoding and decoding payloads class.
|
2 |
This class utilizes BCH codes for error correction.</p>
|
3 |
+
</div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L20">datalayer.ts:20</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="datalayer.DataLayer.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
4 |
+
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="datalayer.DataLayer.html#bch_decoders" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bch_<wbr/>decoders</span></a>
|
5 |
+
<a href="datalayer.DataLayer.html#bch_encoder" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bch_<wbr/>encoder</span></a>
|
6 |
+
<a href="datalayer.DataLayer.html#encoding_mode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoding_<wbr/>mode</span></a>
|
7 |
+
<a href="datalayer.DataLayer.html#payload_len" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>payload_<wbr/>len</span></a>
|
8 |
+
<a href="datalayer.DataLayer.html#versionbits" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>versionbits</span></a>
|
9 |
+
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="datalayer.DataLayer.html#buildbch" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>buildBCH</span></a>
|
10 |
+
<a href="datalayer.DataLayer.html#encodeascii" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Ascii</span></a>
|
11 |
+
<a href="datalayer.DataLayer.html#encodebinary" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Binary</span></a>
|
12 |
+
<a href="datalayer.DataLayer.html#encodepacket" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Packet</span></a>
|
13 |
+
<a href="datalayer.DataLayer.html#encodetext" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Text</span></a>
|
14 |
+
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructordatalayer" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">DataLayer</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">payload_len</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">verbose</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">encoding_mode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="datalayer.DataLayer.html" class="tsd-signature-type tsd-kind-class">DataLayer</a><a href="#constructordatalayer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the DataLayer with specified parameters.</p>
|
15 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">payload_len</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The length of the payload in bits.</p>
|
16 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">verbose</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Flag to indicate if messages should be logged.</p>
|
17 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">encoding_mode</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The encoding mode to be used (default is 0).</p>
|
18 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="datalayer.DataLayer.html" class="tsd-signature-type tsd-kind-class">DataLayer</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L33">datalayer.ts:33</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="bch_decoders" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>bch_<wbr/>decoders</span><a href="#bch_decoders" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bch_decoders</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <a href="bchecc.BCH.html" class="tsd-signature-type tsd-kind-class">BCH</a><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L25">datalayer.ts:25</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="bch_encoder" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>bch_<wbr/>encoder</span><a href="#bch_encoder" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bch_encoder</span><span class="tsd-signature-symbol">:</span> <a href="bchecc.BCH.html" class="tsd-signature-type tsd-kind-class">BCH</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L24">datalayer.ts:24</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="encoding_mode" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encoding_<wbr/>mode</span><a href="#encoding_mode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">encoding_mode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L22">datalayer.ts:22</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="payload_len" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>payload_<wbr/>len</span><a href="#payload_len" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">payload_len</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L21">datalayer.ts:21</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="versionbits" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>versionbits</span><a href="#versionbits" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">versionbits</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L23">datalayer.ts:23</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="buildbch" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>buildBCH</span><a href="#buildbch" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="buildbch-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">buildBCH</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">encoding_mode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="bchecc.BCH.html" class="tsd-signature-type tsd-kind-class">BCH</a><a href="#buildbch-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Builds and returns a BCH instance based on the given encoding mode.</p>
|
19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">encoding_mode</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The encoding mode.</p>
|
20 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="bchecc.BCH.html" class="tsd-signature-type tsd-kind-class">BCH</a></h4><p>A BCH instance configured for the specified encoding mode.</p>
|
21 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L54">datalayer.ts:54</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="encodeascii" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode<wbr/>Ascii</span><a href="#encodeascii" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="encodeascii-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encodeAscii</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">text</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Float32Array</span><a href="#encodeascii-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Encodes a string to a Float32Array using 7-bit ASCII encoding.</p>
|
22 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">text</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The input text string.</p>
|
23 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Float32Array</span></h4><ul>
|
24 |
<li>The encoded Float32Array.</li>
|
25 |
</ul>
|
26 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L148">datalayer.ts:148</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="encodebinary" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode<wbr/>Binary</span><a href="#encodebinary" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="encodebinary-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encodeBinary</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">strbin</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Float32Array</span><a href="#encodebinary-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Encodes a binary string into a Float32Array with the ECC encoding.</p>
|
27 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">strbin</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The input binary string.</p>
|
28 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Float32Array</span></h4><ul>
|
29 |
<li>The encoded Float32Array with the ECC encoding.</li>
|
30 |
</ul>
|
31 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L89">datalayer.ts:89</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="encodepacket" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode<wbr/>Packet</span><a href="#encodepacket" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="encodepacket-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encodePacket</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">packet_d</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Float32Array</span><a href="#encodepacket-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Processes and encodes the packet data.</p>
|
32 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">packet_d</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The binary string representation of the packet data.</p>
|
33 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Float32Array</span></h4><ul>
|
34 |
<li>The encoded Float32Array.</li>
|
35 |
</ul>
|
36 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L99">datalayer.ts:99</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="encodetext" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode<wbr/>Text</span><a href="#encodetext" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="encodetext-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encodeText</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">text</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Float32Array</span><a href="#encodetext-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Encodes a text string into a Float32Array with the ECC encoding.</p>
|
37 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">text</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The input text string.</p>
|
38 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Float32Array</span></h4><ul>
|
39 |
<li>The encoded Float32Array.</li>
|
40 |
</ul>
|
41 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L72">datalayer.ts:72</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#bch_decoders" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bch_<wbr/>decoders</span></a><a href="#bch_encoder" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bch_<wbr/>encoder</span></a><a href="#encoding_mode" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoding_<wbr/>mode</span></a><a href="#payload_len" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>payload_<wbr/>len</span></a><a href="#versionbits" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>versionbits</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#buildbch" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>buildBCH</span></a><a href="#encodeascii" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Ascii</span></a><a href="#encodebinary" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Binary</span></a><a href="#encodepacket" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Packet</span></a><a href="#encodetext" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode<wbr/>Text</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
docs/classes/trustmark.TrustMark.html
CHANGED
@@ -1,40 +1,48 @@
|
|
1 |
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>TrustMark | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="../modules/trustmark.html">trustmark</a></li><li><a href="trustmark.TrustMark.html">TrustMark</a></li></ul><h1>Class TrustMark</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Class representing the TrustMark watermark.
|
2 |
This class utilizes ECC (Error Correction Codes) and ONNX models for encoding and decoding.</p>
|
3 |
-
</div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in trustmark.ts:42</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="trustmark.TrustMark.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
4 |
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="trustmark.TrustMark.html#decoder_session" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>decoder_<wbr/>session</span></a>
|
5 |
-
<a href="trustmark.TrustMark.html#ecc" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ecc</span></a>
|
6 |
-
<a href="trustmark.TrustMark.html#encoder_session" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoder_<wbr/>session</span></a>
|
7 |
-
<a href="trustmark.TrustMark.html#
|
8 |
-
<a href="trustmark.TrustMark.html#
|
9 |
-
<a href="trustmark.TrustMark.html#
|
10 |
-
<a href="trustmark.TrustMark.html#
|
11 |
-
|
12 |
-
<a href="trustmark.TrustMark.html#
|
13 |
-
|
14 |
-
<a href="trustmark.TrustMark.html#
|
15 |
-
<a href="trustmark.TrustMark.html#
|
16 |
-
|
|
|
|
|
17 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">use_ecc</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span><div class="tsd-comment tsd-typography"><p>use BCH error correction on the payload, reducing payload size (default)</p>
|
18 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">secret_len</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 100</span></span><div class="tsd-comment tsd-typography"><p>The length of the secret.</p>
|
19 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">encoding_mode</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = TrustMark.encoding.BCH_4</span></span><div class="tsd-comment tsd-typography"><p>The data schema encoding mode to use.</p>
|
20 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="trustmark.TrustMark.html" class="tsd-signature-type tsd-kind-class">TrustMark</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in trustmark.ts:
|
21 |
<li>Static encoding mapping for different BCH modes.</li>
|
22 |
</ul>
|
23 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in trustmark.ts:44</li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="decode" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>decode</span><a href="#decode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="decode-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">decode</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">image_url</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#decode-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></
|
24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">image_url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The URL of the image to decode.</p>
|
25 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><p>A promise that resolves to the decoded watermnark data.</p>
|
26 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in trustmark.ts:
|
27 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">image_url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The cover image data.</p>
|
28 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">string_secret</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The secret string to encode.</p>
|
29 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">wm_strength</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0.4</span></span><div class="tsd-comment tsd-typography"><p>The watermark strength. Default is 0.4.</p>
|
30 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">maculate</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></span><div class="tsd-comment tsd-typography"><p>Whether to overwrite an existing watermark with random values. Default is false.</p>
|
31 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">output</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = 'bytes'</span></span><div class="tsd-comment tsd-typography"><p>The output format. Default is 'bytes'.</p>
|
32 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><p>A promise that resolves with the encoded data or rejects with an error.</p>
|
33 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in trustmark.ts:
|
34 |
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">image_url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The URL of the image to
|
35 |
-
</div><div class="tsd-comment tsd-typography"></div></li
|
36 |
-
|
37 |
-
|
38 |
-
</div><div class="tsd-
|
39 |
-
</div><div class="tsd-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>TrustMark | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="../modules/trustmark.html">trustmark</a></li><li><a href="trustmark.TrustMark.html">TrustMark</a></li></ul><h1>Class TrustMark</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Class representing the TrustMark watermark.
|
2 |
This class utilizes ECC (Error Correction Codes) and ONNX models for encoding and decoding.</p>
|
3 |
+
</div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L42">trustmark.ts:42</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="trustmark.TrustMark.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
4 |
+
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="trustmark.TrustMark.html#decoder_session" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>decoder_<wbr/>session</span></a>
|
5 |
+
<a href="trustmark.TrustMark.html#ecc" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ecc</span></a>
|
6 |
+
<a href="trustmark.TrustMark.html#encoder_session" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoder_<wbr/>session</span></a>
|
7 |
+
<a href="trustmark.TrustMark.html#model_type" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>model_<wbr/>type</span></a>
|
8 |
+
<a href="trustmark.TrustMark.html#preprocess_224_session" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>preprocess_<wbr/>224_<wbr/>session</span></a>
|
9 |
+
<a href="trustmark.TrustMark.html#preprocess_256_session" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>preprocess_<wbr/>256_<wbr/>session</span></a>
|
10 |
+
<a href="trustmark.TrustMark.html#secret_len" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>secret_<wbr/>len</span></a>
|
11 |
+
<a href="trustmark.TrustMark.html#use_ecc" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use_<wbr/>ecc</span></a>
|
12 |
+
<a href="trustmark.TrustMark.html#encoding" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoding</span></a>
|
13 |
+
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="trustmark.TrustMark.html#decode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>decode</span></a>
|
14 |
+
<a href="trustmark.TrustMark.html#encode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode</span></a>
|
15 |
+
<a href="trustmark.TrustMark.html#loadimage" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>load<wbr/>Image</span></a>
|
16 |
+
<a href="trustmark.TrustMark.html#loadmodels" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>load<wbr/>Models</span></a>
|
17 |
+
<a href="trustmark.TrustMark.html#processimage" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>process<wbr/>Image</span></a>
|
18 |
+
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructortrustmark" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">TrustMark</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">use_ecc</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">secret_len</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">encoding_mode</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="trustmark.TrustMark.html" class="tsd-signature-type tsd-kind-class">TrustMark</a><a href="#constructortrustmark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Constructs a new TrustMark instance.</p>
|
19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">use_ecc</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span><div class="tsd-comment tsd-typography"><p>use BCH error correction on the payload, reducing payload size (default)</p>
|
20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">secret_len</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 100</span></span><div class="tsd-comment tsd-typography"><p>The length of the secret.</p>
|
21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">encoding_mode</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = TrustMark.encoding.BCH_4</span></span><div class="tsd-comment tsd-typography"><p>The data schema encoding mode to use.</p>
|
22 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="trustmark.TrustMark.html" class="tsd-signature-type tsd-kind-class">TrustMark</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L67">trustmark.ts:67</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="decoder_session" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>decoder_<wbr/>session</span><a href="#decoder_session" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">decoder_session</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L55">trustmark.ts:55</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="ecc" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>ecc</span><a href="#ecc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">ecc</span><span class="tsd-signature-symbol">:</span> <a href="datalayer.DataLayer.html" class="tsd-signature-type tsd-kind-class">DataLayer</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L54">trustmark.ts:54</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="encoder_session" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encoder_<wbr/>session</span><a href="#encoder_session" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">encoder_session</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L56">trustmark.ts:56</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="model_type" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>model_<wbr/>type</span><a href="#model_type" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">model_type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L59">trustmark.ts:59</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="preprocess_224_session" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>preprocess_<wbr/>224_<wbr/>session</span><a href="#preprocess_224_session" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">preprocess_224_session</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L57">trustmark.ts:57</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="preprocess_256_session" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>preprocess_<wbr/>256_<wbr/>session</span><a href="#preprocess_256_session" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">preprocess_256_session</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L58">trustmark.ts:58</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="secret_len" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>secret_<wbr/>len</span><a href="#secret_len" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">secret_len</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L53">trustmark.ts:53</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="use_ecc" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use_<wbr/>ecc</span><a href="#use_ecc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">use_ecc</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L52">trustmark.ts:52</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="encoding" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>encoding</span><a href="#encoding" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">encoding</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">BCH_3</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">BCH_4</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">BCH_5</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">BCH_SUPER</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">undefined</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-comment tsd-typography"><ul>
|
23 |
<li>Static encoding mapping for different BCH modes.</li>
|
24 |
</ul>
|
25 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L44">trustmark.ts:44</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="decode" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>decode</span><a href="#decode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="decode-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">decode</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">image_url</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#decode-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Decodes the watermark of an image from a given URL.</p>
|
26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">image_url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The URL of the image to decode.</p>
|
27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><p>A promise that resolves to the decoded watermnark data.</p>
|
28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L79">trustmark.ts:79</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="encode" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encode</span><a href="#encode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="encode-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">encode</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">image_url</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">string_secret</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">wm_strength</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">maculate</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">output</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#encode-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Encodes a secret into an image and returns the stego image and the residual image.</p>
|
29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">image_url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The cover image data.</p>
|
30 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">string_secret</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The secret string to encode.</p>
|
31 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">wm_strength</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0.4</span></span><div class="tsd-comment tsd-typography"><p>The watermark strength. Default is 0.4.</p>
|
32 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">maculate</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></span><div class="tsd-comment tsd-typography"><p>Whether to overwrite an existing watermark with random values. Default is false.</p>
|
33 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">output</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = 'bytes'</span></span><div class="tsd-comment tsd-typography"><p>The output format. Default is 'bytes'.</p>
|
34 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><p>A promise that resolves with the encoded data or rejects with an error.</p>
|
35 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L141">trustmark.ts:141</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="loadimage" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>load<wbr/>Image</span><a href="#loadimage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="loadimage-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">loadImage</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">image_url</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">process_type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#loadimage-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Loads an image from a URL or filesystem and processes it based on the specified type.</p>
|
36 |
+
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">image_url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The URL or filesystem path of the image to be loaded.</p>
|
37 |
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">process_type</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The type of processing to be applied to the image.</p>
|
38 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><p>A promise that resolves with the processed image.</p>
|
39 |
+
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Throws an error if there is an issue loading or processing the image.</p>
|
40 |
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L365">trustmark.ts:365</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="loadmodels" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>load<wbr/>Models</span><a href="#loadmodels" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="loadmodels-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">loadModels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">type</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#loadmodels-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Loads the necessary models based on the specified type.</p>
|
41 |
+
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">type</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = 'Q'</span></span><div class="tsd-comment tsd-typography"><p>The type of models to load ('Q' or 'P').</p>
|
42 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws-1" class="tsd-anchor"></a>Throws<a href="#throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Throws an error if there is an issue loading any of the models.</p>
|
43 |
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L400">trustmark.ts:400</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="processimage" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>process<wbr/>Image</span><a href="#processimage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="processimage-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">processImage</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">image</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">process_type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#processimage-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Processes the input image based on the specified processing type.</p>
|
44 |
+
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">image</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The image object containing the tensor source and other properties.</p>
|
45 |
+
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">process_type</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The type of processing to be applied to the image ('decode' or other types).</p>
|
46 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><p>A promise that resolves with the processed image.</p>
|
47 |
+
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws-2" class="tsd-anchor"></a>Throws<a href="#throws-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Throws an error if there is an issue processing the image.</p>
|
48 |
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/trustmark.ts#L300">trustmark.ts:300</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#decoder_session" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>decoder_<wbr/>session</span></a><a href="#ecc" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ecc</span></a><a href="#encoder_session" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoder_<wbr/>session</span></a><a href="#model_type" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>model_<wbr/>type</span></a><a href="#preprocess_224_session" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>preprocess_<wbr/>224_<wbr/>session</span></a><a href="#preprocess_256_session" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>preprocess_<wbr/>256_<wbr/>session</span></a><a href="#secret_len" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>secret_<wbr/>len</span></a><a href="#use_ecc" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use_<wbr/>ecc</span></a><a href="#encoding" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoding</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#decode" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>decode</span></a><a href="#encode" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encode</span></a><a href="#loadimage" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>load<wbr/>Image</span></a><a href="#loadmodels" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>load<wbr/>Models</span></a><a href="#processimage" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>process<wbr/>Image</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
docs/functions/datalayer.getSchemaCapacity.html
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>getSchemaCapacity | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="../modules/datalayer.html">datalayer</a></li><li><a href="datalayer.getSchemaCapacity.html">getSchemaCapacity</a></li></ul><h1>Function getSchemaCapacity</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getschemacapacity" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getSchemaCapacity</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">schema_version</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><a href="#getschemacapacity" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></
|
2 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">schema_version</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The version of the schema.</p>
|
3 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><ul>
|
4 |
<li>The payload capacity of the schema or 0 if the version is invalid.</li>
|
5 |
</ul>
|
6 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:177</li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>getSchemaCapacity | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="../modules/datalayer.html">datalayer</a></li><li><a href="datalayer.getSchemaCapacity.html">getSchemaCapacity</a></li></ul><h1>Function getSchemaCapacity</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="getschemacapacity" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getSchemaCapacity</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">schema_version</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><a href="#getschemacapacity" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the schema payload capacity based on the given version.</p>
|
2 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">schema_version</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The version of the schema.</p>
|
3 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><ul>
|
4 |
<li>The payload capacity of the schema or 0 if the version is invalid.</li>
|
5 |
</ul>
|
6 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L177">datalayer.ts:177</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
docs/functions/datalayer.getSchemaVersion.html
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>getSchemaVersion | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="../modules/datalayer.html">datalayer</a></li><li><a href="datalayer.getSchemaVersion.html">getSchemaVersion</a></li></ul><h1>Function getSchemaVersion</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getschemaversion" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getSchemaVersion</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">binary_array</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><a href="#getschemaversion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></
|
2 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">binary_array</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>The input binary array.</p>
|
3 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><ul>
|
4 |
<li>The schema version.</li>
|
5 |
</ul>
|
6 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in datalayer.ts:198</li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>getSchemaVersion | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="../modules/datalayer.html">datalayer</a></li><li><a href="datalayer.getSchemaVersion.html">getSchemaVersion</a></li></ul><h1>Function getSchemaVersion</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="getschemaversion" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getSchemaVersion</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">binary_array</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><a href="#getschemaversion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the schema version based on the given binary array.</p>
|
2 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">binary_array</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>The input binary array.</p>
|
3 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><ul>
|
4 |
<li>The schema version.</li>
|
5 |
</ul>
|
6 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/bgon/trustmark.js/blob/af9ff3e40e7e332b93baad3473cd6f5664988512/src/datalayer.ts#L198">datalayer.ts:198</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
docs/index.html
CHANGED
@@ -1,187 +1,37 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<
|
3 |
-
|
4 |
-
<
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
</
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
Click to upload image
|
39 |
-
<label for="upload">(or try examples below)</label>
|
40 |
-
</label>
|
41 |
-
<div class="download-buttons" id="download">
|
42 |
-
|
43 |
-
<button id="download-jpeg" class="download-button" onclick="download('jpeg');">
|
44 |
-
|
45 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 32 32">
|
46 |
-
<path fill="currentColor"
|
47 |
-
d="M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z">
|
48 |
-
</path>
|
49 |
-
</svg>
|
50 |
-
jpeg
|
51 |
-
</button>
|
52 |
-
|
53 |
-
<button id="download-png" class="download-button" onclick="download('png');">
|
54 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 32 32">
|
55 |
-
<path fill="currentColor"
|
56 |
-
d="M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z">
|
57 |
-
</path>
|
58 |
-
</svg>
|
59 |
-
png
|
60 |
-
</button>
|
61 |
-
|
62 |
-
</div>
|
63 |
-
<img id="display_img"></img>
|
64 |
-
</div>
|
65 |
-
<div class="display">
|
66 |
-
<div>
|
67 |
-
<label class="display_label">✨ Residual (x10)</label>
|
68 |
-
<canvas id="residual_img" width="256" height="256"></canvas>
|
69 |
-
</div>
|
70 |
-
|
71 |
-
</div>
|
72 |
-
</div>
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
</div>
|
77 |
-
|
78 |
-
<div class="container">
|
79 |
-
|
80 |
-
<div class="ux">
|
81 |
-
<pre id="status"></pre>
|
82 |
-
<input id="secret" type="text" class="form-control"
|
83 |
-
placeholder="Watermark content: 9 ASCII characters, or 68 bits binary string (maximum length)"
|
84 |
-
aria-label="Watermark payload">
|
85 |
-
<label for="secret"></label>
|
86 |
-
<div class="settings">
|
87 |
-
<div class="model">
|
88 |
-
<input type="checkbox" id="toggle" class="toggleModel" value="P" />
|
89 |
-
<label for="toggle" class="toggleContainer">
|
90 |
-
<div>Quality model</div>
|
91 |
-
<div>Perceptual model</div>
|
92 |
-
</label>
|
93 |
-
</div>
|
94 |
-
<div class="strength">
|
95 |
-
<label for="set_wm_strength">Strength: <span id="wm_strength"><span></span></label>
|
96 |
-
|
97 |
-
<input type="range" id="set_wm_strength" name="set_wm_strength" value=3 min="0" max="30" step="1">
|
98 |
-
</div>
|
99 |
-
|
100 |
-
|
101 |
-
<button class="btn btn-secondary" type="button" id="encode_button">Inject Watermark</button>
|
102 |
-
<button class="btn btn-secondary" type="button" id="erase_button">Erase Watermark</button>
|
103 |
-
<input id="upload" type="file" accept="image/*" />
|
104 |
-
</div>
|
105 |
-
</div>
|
106 |
-
|
107 |
-
<div class="examples">
|
108 |
-
<div>
|
109 |
-
<h4>
|
110 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"
|
111 |
-
role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32">
|
112 |
-
<path fill="currentColor" d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z">
|
113 |
-
</path>
|
114 |
-
</svg> <a href="/docs/"> Documentation </a>
|
115 |
-
</h4>
|
116 |
-
<h4>
|
117 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"
|
118 |
-
role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32">
|
119 |
-
<path fill="currentColor" d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z">
|
120 |
-
</path>
|
121 |
-
</svg> Examples, without watermark
|
122 |
-
</h4>
|
123 |
-
<div class="gallery">
|
124 |
-
<div class="gallery-item" id="ex1">
|
125 |
-
<img src="tests/fixtures/Django_Reinhardt_(Gottlieb_07301).jpeg"
|
126 |
-
alt="Django Reinhardt at the Aquarium jazz club in New York, NY by William P. Gottlieb (Gottlieb_07301), CC0 Public Domain Dedication"
|
127 |
-
name="Django_Reinhardt_(Gottlieb_07301)" class="img-thumbnail" onclick="decode_ex(this);">
|
128 |
-
</div>
|
129 |
-
<div class="gallery-item" id="ex2">
|
130 |
-
<img src="tests/fixtures/Schongau,_Photon-Stromtankstelle_im_Bahnhof,_1.jpeg"
|
131 |
-
name="Schongau,_Photon-Stromtankstelle_im_Bahnhof,_1"
|
132 |
-
alt="Schongau, eine Photon-Stromtankstelle für Züge am Bahnhof. By Renardo la vulpo, CC0 Public Domain Dedication"
|
133 |
-
class="img-thumbnail" onclick="decode_ex(this);">
|
134 |
-
</div>
|
135 |
-
<div class="gallery-item" id="ex3">
|
136 |
-
<img src="tests/fixtures/Grand_Canyon_South_Rim_at_Sunset.jpeg"
|
137 |
-
alt="Grand Canyon South Rim at Sunset, by Mgimelfarb, CC0 Public Domain Dedication"
|
138 |
-
name="Grand_Canyon_South_Rim_at_Sunset" class="img-thumbnail" onclick="decode_ex(this);">
|
139 |
-
</div>
|
140 |
-
<div class="gallery-item" id="ex3">
|
141 |
-
<img src="tests/fixtures/Quarry_Bay_apartments_(Unsplash).jpeg"
|
142 |
-
alt="Quarry Bay apartments, by Brian Sugden, CC0 Public Domain Dedication"
|
143 |
-
name="Quarry_Bay_apartments_(Unsplash)" class="img-thumbnail" onclick="decode_ex(this);">
|
144 |
-
</div>
|
145 |
-
|
146 |
-
</div>
|
147 |
-
</div>
|
148 |
-
</div>
|
149 |
-
<div class="examples">
|
150 |
-
<div>
|
151 |
-
<h4>
|
152 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"
|
153 |
-
role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32">
|
154 |
-
<path fill="currentColor" d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z">
|
155 |
-
</path>
|
156 |
-
</svg> Examples, with watermark
|
157 |
-
</h4>
|
158 |
-
<div class="gallery">
|
159 |
-
<div class="gallery-item" id="ex1">
|
160 |
-
<img src="tests/fixtures/Django_Reinhardt_(Gottlieb_07301)_watermarked.jpeg"
|
161 |
-
alt="Django Reinhardt at the Aquarium jazz club in New York, NY by William P. Gottlieb (Gottlieb_07301), CC0 Public Domain Dedication"
|
162 |
-
name="Django_Reinhardt_(Gottlieb_07301)" class="img-thumbnail" onclick="decode_ex(this);">
|
163 |
-
</div>
|
164 |
-
<div class="gallery-item" id="ex2">
|
165 |
-
<img src="tests/fixtures/Schongau,_Photon-Stromtankstelle_im_Bahnhof,_1_watermarked.jpeg"
|
166 |
-
name="Schongau,_Photon-Stromtankstelle_im_Bahnhof,_1"
|
167 |
-
alt="Schongau, eine Photon-Stromtankstelle für Züge am Bahnhof. By Renardo la vulpo, CC0 Public Domain Dedication"
|
168 |
-
class="img-thumbnail" onclick="decode_ex(this);">
|
169 |
-
</div>
|
170 |
-
<div class="gallery-item" id="ex3">
|
171 |
-
<img src="tests/fixtures/Grand_Canyon_South_Rim_at_Sunset_watermarked.jpeg"
|
172 |
-
alt="Grand Canyon South Rim at Sunset, by Mgimelfarb, CC0 Public Domain Dedication"
|
173 |
-
name="Grand_Canyon_South_Rim_at_Sunset" class="img-thumbnail" onclick="decode_ex(this);">
|
174 |
-
</div>
|
175 |
-
<div class="gallery-item" id="ex3">
|
176 |
-
<img src="tests/fixtures/Quarry_Bay_apartments_(Unsplash)_watermarked.jpeg"
|
177 |
-
alt="Quarry Bay apartments, by Brian Sugden, CC0 Public Domain Dedication"
|
178 |
-
name="Quarry_Bay_apartments_(Unsplash)" class="img-thumbnail" onclick="decode_ex(this);">
|
179 |
-
</div>
|
180 |
-
|
181 |
-
</div>
|
182 |
-
</div>
|
183 |
-
</div>
|
184 |
-
</div>
|
185 |
-
</body>
|
186 |
-
|
187 |
-
</html>
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base="."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>TrustMark.js</title><link rel="icon" href="assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h1>TrustMark.js</h1></div><div class="tsd-panel tsd-typography"><a id="trustmarkjs" class="tsd-anchor"></a><h1 class="tsd-anchor-link">TrustMark.js<a href="#trustmarkjs" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Javascript implementation of TrustMark watermarking as described in <a href="https://arxiv.org/abs/2311.18297">TrustMark - Universal Watermarking for Arbitrary Resolution Images</a> for encoding & decoding TrustMark watermarks in modern browsers as well as Node.js.</p>
|
2 |
+
<a id="important" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Important!<a href="#important" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>TrustMark.js <strong>is not suitable</strong> for production environments. Handling large image files significantly increases memory allocation, which can cause browser tab crashes or memory errors in a Node.js environment.</p>
|
3 |
+
<a id="usage-browser" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Usage Browser<a href="#usage-browser" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Add the <code>onnxruntime-web</code> and <code>@tensorflow/tfjs</code> dependencies to your main HTML file:</p>
|
4 |
+
<pre><code class="html"><span class="hl-0"><</span><span class="hl-1">script</span><span class="hl-2"> </span><span class="hl-3">src</span><span class="hl-2">=</span><span class="hl-4">"https://cdn.jsdelivr.net/npm/onnxruntime-web@latest/dist/ort.min.js"</span><span class="hl-0">></</span><span class="hl-1">script</span><span class="hl-0">></span><br/><span class="hl-0"><</span><span class="hl-1">script</span><span class="hl-2"> </span><span class="hl-3">src</span><span class="hl-2">=</span><span class="hl-4">"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest/dist/tf.min.js"</span><span class="hl-0">></</span><span class="hl-1">script</span><span class="hl-0">></span>
|
5 |
+
</code><button type="button">Copy</button></pre>
|
6 |
+
|
7 |
+
<pre><code class="javascript"><span class="hl-5">import</span><span class="hl-6"> { </span><span class="hl-7">TrustMark</span><span class="hl-6"> } </span><span class="hl-5">from</span><span class="hl-6"> </span><span class="hl-8">'./dist/index.js'</span><span class="hl-6">;</span><br/><span class="hl-9">//Instanciate Trustmark</span><br/><span class="hl-10">const</span><span class="hl-6"> </span><span class="hl-11">tm</span><span class="hl-6"> = </span><span class="hl-10">new</span><span class="hl-6"> </span><span class="hl-12">TrustMark</span><span class="hl-6">()</span><br/><br/><span class="hl-9">// Load the models</span><br/><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">load_models</span><span class="hl-6">()</span><br/><span class="hl-9">// Decode an Image</span><br/><span class="hl-10">let</span><span class="hl-6"> </span><span class="hl-7">decoded</span><span class="hl-6"> = </span><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">decode</span><span class="hl-6">(</span><span class="hl-8">"tests/fixtures/Django_Reinhardt_(Gottlieb_07301)_watermarked.jpeg"</span><span class="hl-6">);</span>
|
8 |
+
</code><button type="button">Copy</button></pre>
|
9 |
+
|
10 |
+
<p>Note: CPU and WebGL backends are included by default in <code>@tensorflow/tfjs</code>.</p>
|
11 |
+
<a id="usage-nodejs" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Usage Node.js<a href="#usage-nodejs" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><pre><code class="javascript"><span class="hl-5">import</span><span class="hl-6"> { </span><span class="hl-7">TrustMark</span><span class="hl-6"> } </span><span class="hl-5">from</span><span class="hl-6"> </span><span class="hl-8">'./dist/index.cjs'</span><span class="hl-6">;</span><br/><span class="hl-9">//Instanciate Trustmark</span><br/><span class="hl-10">const</span><span class="hl-6"> </span><span class="hl-11">tm</span><span class="hl-6"> = </span><span class="hl-10">new</span><span class="hl-6"> </span><span class="hl-12">TrustMark</span><span class="hl-6">()</span><br/><br/><span class="hl-9">// Load the models</span><br/><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">load_models</span><span class="hl-6">()</span><br/><span class="hl-9">// Decode an Image</span><br/><span class="hl-10">let</span><span class="hl-6"> </span><span class="hl-7">decoded</span><span class="hl-6"> = </span><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">decode</span><span class="hl-6">(</span><span class="hl-8">"tests/fixtures/CLIC_watermarked.jpeg"</span><span class="hl-6">);</span>
|
12 |
+
</code><button type="button">Copy</button></pre>
|
13 |
+
|
14 |
+
<p><a href="https://github.com/tensorflow/tfjs/blob/master/tfjs-node/README.md">tfjs-node-gpu</a> is recommended for Node.js if you need to watermark large image files.</p>
|
15 |
+
<a id="models" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Models<a href="#models" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>TrustMark.js is using the Q (quality) and P (perceptual) model variants, trained to encode a payload of 100 bits. Models are fetched and cached on first use into <code>models</code> directory on Node.js, and into the <a href="https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage">CacheStorage</a> in a browser environment.</p>
|
16 |
+
<a id="trustmark-q-quality-default" class="tsd-anchor"></a><h2 class="tsd-anchor-link">TrustMark-Q (Quality) (default)<a href="#trustmark-q-quality-default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Offers a good balance between robustness and quality</p>
|
17 |
+
<a id="trustmark-p-perceptual" class="tsd-anchor"></a><h2 class="tsd-anchor-link">TrustMark-P (Perceptual)<a href="#trustmark-p-perceptual" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Gives high visual quality with PSNR exceeding 50db but less robustness to more severe noise degradations, yet it will survive most content distribution platforms.</p>
|
18 |
+
<a id="supported-data-schema-modes" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Supported data schema modes<a href="#supported-data-schema-modes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
|
19 |
+
<li><code>Encoding.BCH_5</code> - Protected payload of 61 bits (+ 35 ECC bits) - allows for 5 bit flips.</li>
|
20 |
+
<li><code>Encoding.BCH_4</code> - Protected payload of 68 bits (+ 28 ECC bits) - allows for 4 bit flips. (default)</li>
|
21 |
+
<li><code>Encoding.BCH_3</code> - Protected payload of 75 bits (+ 21 ECC bits) - allows for 3 bit flips.</li>
|
22 |
+
<li><code>Encoding.BCH_SUPER</code> - Protected payload of 40 bits (+ 56 ECC bits) - allows for 8 bit flips.</li>
|
23 |
+
</ul>
|
24 |
+
<a id="preprocessing-model" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Preprocessing model<a href="#preprocessing-model" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>The models <code>models/preprocess_224.onnx</code> and <code>models/preprocess_256.onnx</code> are used to resize images to the format expected as input for the Trustmark models. It is mandatory to get the same inference results as the original Python implementation.</p>
|
25 |
+
<a id="decode" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Decode<a href="#decode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><pre><code class="javascript"><span class="hl-9">// Decode the watermark of an image</span><br/><span class="hl-10">let</span><span class="hl-6"> </span><span class="hl-7">decoded</span><span class="hl-6"> = </span><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">decode</span><span class="hl-6">(</span><span class="hl-8">"tests/fixtures/Django_Reinhardt_(Gottlieb_07301)_watermarked.jpeg"</span><span class="hl-6">);</span><br/><span class="hl-9">/*</span><br/><span class="hl-9">return:</span><br/><span class="hl-9">{</span><br/><span class="hl-9">bitflips, (number) - corrected bits</span><br/><span class="hl-9">valid, (boolean) - validity of the decoded watermark</span><br/><span class="hl-9">binary, (string) - string representation of decoded bits</span><br/><span class="hl-9">hex,(string) - string representation of decoded bits as hexadecimal</span><br/><span class="hl-9">ascii (string) - string representation of decoded bits as 7-bit ASCII</span><br/><span class="hl-9">}</span><br/><span class="hl-9">*/</span>
|
26 |
+
</code><button type="button">Copy</button></pre>
|
27 |
+
|
28 |
+
<a id="encode" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Encode<a href="#encode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><a id="text-mode" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Text mode<a href="#text-mode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>The payload is encoded as ASCII 7 bits. The 68 bits give you 9 characters.</p>
|
29 |
+
<a id="binary-mode" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Binary mode<a href="#binary-mode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>The 68 bits give you 8 bytes.</p>
|
30 |
+
<pre><code class="javascript"><span class="hl-9">// text mode, 0.4 strenght, no erase</span><br/><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">encode</span><span class="hl-6">(</span><span class="hl-8">"tests/fixtures/Django_Reinhardt_(Gottlieb_07301).jpeg"</span><span class="hl-6">, </span><span class="hl-8">'Marzipan'</span><span class="hl-6">, </span><span class="hl-13">0.4</span><span class="hl-6">, </span><span class="hl-10">false</span><span class="hl-6">);</span><br/><br/><span class="hl-9">// binary mode 0.4 strenght, no erase</span><br/><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">encode</span><span class="hl-6">(</span><span class="hl-8">"tests/fixtures/Django_Reinhardt_(Gottlieb_07301).jpeg"</span><span class="hl-6">, </span><span class="hl-8">'11011011110100011110010101000111000100110101010010101110101011011011'</span><span class="hl-6">, </span><span class="hl-13">0.4</span><span class="hl-6">, </span><span class="hl-10">false</span><span class="hl-6">);</span><br/><br/><span class="hl-9">// text mode, 0.4 strenght, no erase as a png encoded file</span><br/><span class="hl-10">let</span><span class="hl-6"> </span><span class="hl-7">encoded</span><span class="hl-6"> = </span><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">encode</span><span class="hl-6">(</span><span class="hl-8">"tests/fixtures/Django_Reinhardt_(Gottlieb_07301).jpeg"</span><span class="hl-6">, </span><span class="hl-8">'Marzipan'</span><span class="hl-6">, </span><span class="hl-13">0.4</span><span class="hl-6">, </span><span class="hl-10">false</span><span class="hl-6">, </span><span class="hl-8">'png'</span><span class="hl-6">)</span><br/><br/><br/><span class="hl-9">/*</span><br/><span class="hl-9">return:</span><br/><span class="hl-9">{</span><br/><span class="hl-9">stego, (Uint8ClampedArray | PNG data) - the watermaked image data</span><br/><span class="hl-9">residual, (Uint8ClampedArray | PNG data) - the residual image data</span><br/><span class="hl-9">width, (number) - width of the watermaked image</span><br/><span class="hl-9">height,(number) - height of the watermaked image</span><br/><span class="hl-9">}</span><br/><span class="hl-9">*/</span>
|
31 |
+
</code><button type="button">Copy</button></pre>
|
32 |
+
|
33 |
+
<a id="erase" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Erase<a href="#erase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Overwrite an existing watermark with random values.</p>
|
34 |
+
<pre><code class="javascript"><span class="hl-9">// erase, 0.4 strenght</span><br/><span class="hl-5">await</span><span class="hl-6"> </span><span class="hl-7">tm</span><span class="hl-6">.</span><span class="hl-12">encode</span><span class="hl-6">(</span><span class="hl-8">"tests/fixtures/Django_Reinhardt_(Gottlieb_07301)_watermarked.jpeg"</span><span class="hl-6">, </span><span class="hl-8">''</span><span class="hl-6">, </span><span class="hl-13">0.4</span><span class="hl-6">, </span><span class="hl-10">true</span><span class="hl-6">);</span><br/><br/><span class="hl-9">/*</span><br/><span class="hl-9">return:</span><br/><span class="hl-9">{</span><br/><span class="hl-9">stego, (Uint8ClampedArray | PNG data) - the image data with the watermark erased.</span><br/><span class="hl-9">residual, (Uint8ClampedArray | PNG data) - the residual image data</span><br/><span class="hl-9">width, (number) - width of the image</span><br/><span class="hl-9">height,(number) - height of the image</span><br/><span class="hl-9">}</span><br/><span class="hl-9">*/</span>
|
35 |
+
</code><button type="button">Copy</button></pre>
|
36 |
+
|
37 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#trustmarkjs"><span>Trust<wbr/>Mark.js</span></a><a href="#important"><span>Important!</span></a><a href="#usage-browser"><span>Usage <wbr/>Browser</span></a><a href="#usage-nodejs"><span>Usage <wbr/>Node.js</span></a><a href="#models"><span>Models</span></a><ul><li><a href="#trustmark-q-quality-default"><span>Trust<wbr/>Mark-<wbr/>Q (<wbr/>Quality) (default)</span></a></li><li><a href="#trustmark-p-perceptual"><span>Trust<wbr/>Mark-<wbr/>P (<wbr/>Perceptual)</span></a></li><li><a href="#supported-data-schema-modes"><span>Supported data schema modes</span></a></li><li><a href="#preprocessing-model"><span>Preprocessing model</span></a></li></ul><a href="#decode"><span>Decode</span></a><a href="#encode"><span>Encode</span></a><ul><li><a href="#text-mode"><span>Text mode</span></a></li><li><a href="#binary-mode"><span>Binary mode</span></a></li></ul><a href="#erase"><span>Erase</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/modules.html
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<!DOCTYPE html><html class="default" lang="en" data-base="."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>TrustMark.js</title><link rel="icon" href="assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="modules.html">TrustMark.js</a></li></ul><h1>TrustMark.js</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Modules"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg> Modules</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="bchecc" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><a href="modules/bchecc.html">bchecc</a><a href="#bchecc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd><dt class="tsd-member-summary"><a id="datalayer" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><a href="modules/datalayer.html">datalayer</a><a href="#datalayer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd><dt class="tsd-member-summary"><a id="trustmark" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><a href="modules/trustmark.html">trustmark</a><a href="#trustmark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Modules"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Modules</summary><div><a href="#bchecc" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>bchecc</span></a><a href="#datalayer" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>datalayer</span></a><a href="#trustmark" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>trustmark</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base="."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>TrustMark.js</title><link rel="icon" href="assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="modules.html">TrustMark.js</a></li></ul><h1>TrustMark.js</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Modules"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg> Modules</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="bchecc" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Module"><use href="assets/icons.svg#icon-2"></use></svg><a href="modules/bchecc.html">bchecc</a><a href="#bchecc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd><dt class="tsd-member-summary"><a id="datalayer" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Module"><use href="assets/icons.svg#icon-2"></use></svg><a href="modules/datalayer.html">datalayer</a><a href="#datalayer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd><dt class="tsd-member-summary"><a id="trustmark" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Module"><use href="assets/icons.svg#icon-2"></use></svg><a href="modules/trustmark.html">trustmark</a><a href="#trustmark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Modules"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Modules</summary><div><a href="#bchecc" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Module"><use href="assets/icons.svg#icon-2"></use></svg><span>bchecc</span></a><a href="#datalayer" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Module"><use href="assets/icons.svg#icon-2"></use></svg><span>datalayer</span></a><a href="#trustmark" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Module"><use href="assets/icons.svg#icon-2"></use></svg><span>trustmark</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
docs/modules/bchecc.html
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>bchecc | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="bchecc.html">bchecc</a></li></ul><h1>Module bchecc</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Classes"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Classes</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="bch" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-128"></use></svg><a href="../classes/bchecc.BCH.html">BCH</a><a href="#bch" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Classes"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Classes</summary><div><a href="#bch" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-128"></use></svg><span>BCH</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>bchecc | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="bchecc.html">bchecc</a></li></ul><h1>Module bchecc</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Classes"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Classes</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="bch" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Class"><use href="../assets/icons.svg#icon-128"></use></svg><a href="../classes/bchecc.BCH.html">BCH</a><a href="#bch" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Classes"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Classes</summary><div><a href="#bch" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Class"><use href="../assets/icons.svg#icon-128"></use></svg><span>BCH</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
docs/modules/datalayer.html
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>datalayer | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="datalayer.html">datalayer</a></li></ul><h1>Module datalayer</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Classes"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Classes</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="datalayer" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-128"></use></svg><a href="../classes/datalayer.DataLayer.html">DataLayer</a><a href="#datalayer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Functions"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Functions</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="getschemacapacity" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><a href="../functions/datalayer.getSchemaCapacity.html">getSchemaCapacity</a><a href="#getschemacapacity" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd><dt class="tsd-member-summary"><a id="getschemaversion" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><a href="../functions/datalayer.getSchemaVersion.html">getSchemaVersion</a><a href="#getschemaversion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Classes"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Classes</summary><div><a href="#datalayer" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-128"></use></svg><span>Data<wbr/>Layer</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Functions"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Functions</summary><div><a href="#getschemacapacity" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><span>get<wbr/>Schema<wbr/>Capacity</span></a><a href="#getschemaversion" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><span>get<wbr/>Schema<wbr/>Version</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>datalayer | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="datalayer.html">datalayer</a></li></ul><h1>Module datalayer</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Classes"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Classes</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="datalayer" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Class"><use href="../assets/icons.svg#icon-128"></use></svg><a href="../classes/datalayer.DataLayer.html">DataLayer</a><a href="#datalayer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Functions"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Functions</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="getschemacapacity" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="../assets/icons.svg#icon-64"></use></svg><a href="../functions/datalayer.getSchemaCapacity.html">getSchemaCapacity</a><a href="#getschemacapacity" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd><dt class="tsd-member-summary"><a id="getschemaversion" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="../assets/icons.svg#icon-64"></use></svg><a href="../functions/datalayer.getSchemaVersion.html">getSchemaVersion</a><a href="#getschemaversion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Classes"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Classes</summary><div><a href="#datalayer" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Class"><use href="../assets/icons.svg#icon-128"></use></svg><span>Data<wbr/>Layer</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Functions"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Functions</summary><div><a href="#getschemacapacity" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="../assets/icons.svg#icon-64"></use></svg><span>get<wbr/>Schema<wbr/>Capacity</span></a><a href="#getschemaversion" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="../assets/icons.svg#icon-64"></use></svg><span>get<wbr/>Schema<wbr/>Version</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
docs/modules/trustmark.html
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>trustmark | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="trustmark.html">trustmark</a></li></ul><h1>Module trustmark</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Classes"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Classes</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="trustmark" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-128"></use></svg><a href="../classes/trustmark.TrustMark.html">TrustMark</a><a href="#trustmark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Classes"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Classes</summary><div><a href="#trustmark" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-128"></use></svg><span>Trust<wbr/>Mark</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
|
1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>trustmark | TrustMark.js</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for TrustMark.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">TrustMark.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">TrustMark.js</a></li><li><a href="trustmark.html">trustmark</a></li></ul><h1>Module trustmark</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Classes"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Classes</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary"><a id="trustmark" class="tsd-anchor"></a><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Class"><use href="../assets/icons.svg#icon-128"></use></svg><a href="../classes/trustmark.TrustMark.html">TrustMark</a><a href="#trustmark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Classes"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Classes</summary><div><a href="#trustmark" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Class"><use href="../assets/icons.svg#icon-128"></use></svg><span>Trust<wbr/>Mark</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">TrustMark.js</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
index.html
CHANGED
@@ -19,16 +19,16 @@
|
|
19 |
target="_blank" rel="noopener noreferrer">TrustMark - Universal
|
20 |
Watermarking for Arbitrary Resolution Images</a>, for
|
21 |
encoding & decoding TrustMark watermarks locally in modern browsers as well as Node.js.</p>
|
22 |
-
|
23 |
|
24 |
</div>
|
25 |
|
26 |
<div class="container">
|
27 |
<div class="row">
|
28 |
<div id="image_container" class="display">
|
29 |
-
<div class="loader" id="processing"></div>
|
30 |
<div id="processing"></div>
|
31 |
-
<label for="upload" class="display_label" id="result"
|
32 |
<label for="upload" id="tooltip">
|
33 |
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
34 |
<path fill="#000"
|
@@ -64,7 +64,7 @@
|
|
64 |
</div>
|
65 |
<div class="display">
|
66 |
<div>
|
67 |
-
<label class="display_label"
|
68 |
<canvas id="residual_img" width="256" height="256"></canvas>
|
69 |
</div>
|
70 |
|
@@ -79,9 +79,18 @@
|
|
79 |
|
80 |
<div class="ux">
|
81 |
<pre id="status"></pre>
|
82 |
-
<input id="secret" type="text" class="form-control"
|
|
|
|
|
83 |
<label for="secret"></label>
|
84 |
<div class="settings">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
<div class="strength">
|
86 |
<label for="set_wm_strength">Strength: <span id="wm_strength"><span></span></label>
|
87 |
|
@@ -102,7 +111,7 @@
|
|
102 |
role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32">
|
103 |
<path fill="currentColor" d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z">
|
104 |
</path>
|
105 |
-
</svg> <a href="
|
106 |
</h4>
|
107 |
<h4>
|
108 |
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"
|
@@ -128,6 +137,12 @@
|
|
128 |
alt="Grand Canyon South Rim at Sunset, by Mgimelfarb, CC0 Public Domain Dedication"
|
129 |
name="Grand_Canyon_South_Rim_at_Sunset" class="img-thumbnail" onclick="decode_ex(this);">
|
130 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
</div>
|
132 |
</div>
|
133 |
</div>
|
@@ -157,6 +172,12 @@
|
|
157 |
alt="Grand Canyon South Rim at Sunset, by Mgimelfarb, CC0 Public Domain Dedication"
|
158 |
name="Grand_Canyon_South_Rim_at_Sunset" class="img-thumbnail" onclick="decode_ex(this);">
|
159 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
</div>
|
161 |
</div>
|
162 |
</div>
|
|
|
19 |
target="_blank" rel="noopener noreferrer">TrustMark - Universal
|
20 |
Watermarking for Arbitrary Resolution Images</a>, for
|
21 |
encoding & decoding TrustMark watermarks locally in modern browsers as well as Node.js.</p>
|
22 |
+
|
23 |
|
24 |
</div>
|
25 |
|
26 |
<div class="container">
|
27 |
<div class="row">
|
28 |
<div id="image_container" class="display">
|
29 |
+
<div class="loader" id="processing"></div>
|
30 |
<div id="processing"></div>
|
31 |
+
<label for="upload" class="display_label" id="result">🖼️ Input Image</label>
|
32 |
<label for="upload" id="tooltip">
|
33 |
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
34 |
<path fill="#000"
|
|
|
64 |
</div>
|
65 |
<div class="display">
|
66 |
<div>
|
67 |
+
<label class="display_label">✨ Residual (x10)</label>
|
68 |
<canvas id="residual_img" width="256" height="256"></canvas>
|
69 |
</div>
|
70 |
|
|
|
79 |
|
80 |
<div class="ux">
|
81 |
<pre id="status"></pre>
|
82 |
+
<input id="secret" type="text" class="form-control"
|
83 |
+
placeholder="Watermark content: 9 ASCII characters, or 68 bits binary string (maximum length)"
|
84 |
+
aria-label="Watermark payload">
|
85 |
<label for="secret"></label>
|
86 |
<div class="settings">
|
87 |
+
<div class="model">
|
88 |
+
<input type="checkbox" id="toggle" class="toggleModel" value="P" />
|
89 |
+
<label for="toggle" class="toggleContainer">
|
90 |
+
<div>Quality model</div>
|
91 |
+
<div>Perceptual model</div>
|
92 |
+
</label>
|
93 |
+
</div>
|
94 |
<div class="strength">
|
95 |
<label for="set_wm_strength">Strength: <span id="wm_strength"><span></span></label>
|
96 |
|
|
|
111 |
role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32">
|
112 |
<path fill="currentColor" d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z">
|
113 |
</path>
|
114 |
+
</svg> <a href="/docs/"> Documentation </a>
|
115 |
</h4>
|
116 |
<h4>
|
117 |
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"
|
|
|
137 |
alt="Grand Canyon South Rim at Sunset, by Mgimelfarb, CC0 Public Domain Dedication"
|
138 |
name="Grand_Canyon_South_Rim_at_Sunset" class="img-thumbnail" onclick="decode_ex(this);">
|
139 |
</div>
|
140 |
+
<div class="gallery-item" id="ex3">
|
141 |
+
<img src="tests/fixtures/Quarry_Bay_apartments_(Unsplash).jpeg"
|
142 |
+
alt="Quarry Bay apartments, by Brian Sugden, CC0 Public Domain Dedication"
|
143 |
+
name="Quarry_Bay_apartments_(Unsplash)" class="img-thumbnail" onclick="decode_ex(this);">
|
144 |
+
</div>
|
145 |
+
|
146 |
</div>
|
147 |
</div>
|
148 |
</div>
|
|
|
172 |
alt="Grand Canyon South Rim at Sunset, by Mgimelfarb, CC0 Public Domain Dedication"
|
173 |
name="Grand_Canyon_South_Rim_at_Sunset" class="img-thumbnail" onclick="decode_ex(this);">
|
174 |
</div>
|
175 |
+
<div class="gallery-item" id="ex3">
|
176 |
+
<img src="tests/fixtures/Quarry_Bay_apartments_(Unsplash)_watermarked.jpeg"
|
177 |
+
alt="Quarry Bay apartments, by Brian Sugden, CC0 Public Domain Dedication"
|
178 |
+
name="Quarry_Bay_apartments_(Unsplash)" class="img-thumbnail" onclick="decode_ex(this);">
|
179 |
+
</div>
|
180 |
+
|
181 |
</div>
|
182 |
</div>
|
183 |
</div>
|
index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import { TrustMark } from '
|
2 |
|
3 |
// ======================================================================
|
4 |
// Global variables
|
@@ -23,6 +23,7 @@ let set_wm_strength_slider = document.getElementById("set_wm_strength");
|
|
23 |
let wm_strength = document.getElementById('wm_strength')
|
24 |
let encode_button = document.getElementById("encode_button");
|
25 |
let erase_button = document.getElementById("erase_button");
|
|
|
26 |
let fileUpload = document.getElementById("upload");
|
27 |
let fileDownload = document.getElementById("download");
|
28 |
let tooltip = document.getElementById("tooltip");
|
@@ -35,6 +36,7 @@ window.addEventListener('status', (event) => {
|
|
35 |
|
36 |
wm_strength.textContent = WM_STRENGTH
|
37 |
|
|
|
38 |
let current_image;
|
39 |
let tm = new TrustMark({ verbose: false, model_type: MODE, encoding_type: ENCODING_TYPE })
|
40 |
showSpinner()
|
@@ -47,6 +49,10 @@ hideSpinner()
|
|
47 |
// UI functions
|
48 |
// ======================================================================
|
49 |
|
|
|
|
|
|
|
|
|
50 |
encode_button.addEventListener("click", async b => {
|
51 |
encode().catch(e => { console.error(e) });
|
52 |
});
|
@@ -99,7 +105,6 @@ fileUpload.addEventListener("change", function (b) {
|
|
99 |
});
|
100 |
|
101 |
window.decode_ex = (image) => {
|
102 |
-
image.crossOrigin = "anonymous";
|
103 |
display_img.src = image.src
|
104 |
current_image = {
|
105 |
url: image.src,
|
|
|
1 |
+
import { TrustMark } from './dist/index.js'
|
2 |
|
3 |
// ======================================================================
|
4 |
// Global variables
|
|
|
23 |
let wm_strength = document.getElementById('wm_strength')
|
24 |
let encode_button = document.getElementById("encode_button");
|
25 |
let erase_button = document.getElementById("erase_button");
|
26 |
+
let model_type_toggle = document.getElementById("toggle");
|
27 |
let fileUpload = document.getElementById("upload");
|
28 |
let fileDownload = document.getElementById("download");
|
29 |
let tooltip = document.getElementById("tooltip");
|
|
|
36 |
|
37 |
wm_strength.textContent = WM_STRENGTH
|
38 |
|
39 |
+
|
40 |
let current_image;
|
41 |
let tm = new TrustMark({ verbose: false, model_type: MODE, encoding_type: ENCODING_TYPE })
|
42 |
showSpinner()
|
|
|
49 |
// UI functions
|
50 |
// ======================================================================
|
51 |
|
52 |
+
model_type_toggle.addEventListener("click", async b => {
|
53 |
+
if(model_type_toggle.checked===true){await tm.loadModels('P')};
|
54 |
+
if(model_type_toggle.checked===false){await tm.loadModels('Q')};
|
55 |
+
});
|
56 |
encode_button.addEventListener("click", async b => {
|
57 |
encode().catch(e => { console.error(e) });
|
58 |
});
|
|
|
105 |
});
|
106 |
|
107 |
window.decode_ex = (image) => {
|
|
|
108 |
display_img.src = image.src
|
109 |
current_image = {
|
110 |
url: image.src,
|
style.css
CHANGED
@@ -175,6 +175,8 @@ input[type="number"] {
|
|
175 |
|
176 |
.strength label {
|
177 |
width: 30%;
|
|
|
|
|
178 |
}
|
179 |
|
180 |
.settings {
|
@@ -291,4 +293,68 @@ svg {
|
|
291 |
100% {
|
292 |
transform: rotate(360deg);
|
293 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
}
|
|
|
175 |
|
176 |
.strength label {
|
177 |
width: 30%;
|
178 |
+
font-weight: bold;
|
179 |
+
text-align: center;
|
180 |
}
|
181 |
|
182 |
.settings {
|
|
|
293 |
100% {
|
294 |
transform: rotate(360deg);
|
295 |
}
|
296 |
+
}
|
297 |
+
|
298 |
+
.toggleContainer {
|
299 |
+
position: relative;
|
300 |
+
display: grid;
|
301 |
+
grid-template-columns: repeat(2, 1fr);
|
302 |
+
width: fit-content;
|
303 |
+
border: 1px solid #D1D5DB;
|
304 |
+
border-radius: 16px;
|
305 |
+
background: rgb(55, 65, 81);
|
306 |
+
font-weight: bold;
|
307 |
+
color: rgb(55, 65, 81);
|
308 |
+
cursor: pointer;
|
309 |
+
margin-right: 10px;
|
310 |
+
}
|
311 |
+
|
312 |
+
.toggleContainer::before {
|
313 |
+
content: '';
|
314 |
+
position: absolute;
|
315 |
+
width: 50%;
|
316 |
+
height: 100%;
|
317 |
+
left: 0%;
|
318 |
+
border-radius: 16px;
|
319 |
+
background: rgb(55, 65, 81);
|
320 |
+
background-image: linear-gradient(to right bottom, rgb(243, 244, 246), rgb(229, 231, 235));
|
321 |
+
transition: all 0.3s;
|
322 |
+
}
|
323 |
+
|
324 |
+
.toggleModel:checked+.toggleContainer::before {
|
325 |
+
left: 50%;
|
326 |
+
}
|
327 |
+
|
328 |
+
.toggleContainer div {
|
329 |
+
padding: 4px;
|
330 |
+
text-align: center;
|
331 |
+
z-index: 1;
|
332 |
+
}
|
333 |
+
|
334 |
+
.toggleModel {
|
335 |
+
display: none;
|
336 |
+
}
|
337 |
+
|
338 |
+
.toggleModel:checked+.toggleContainer div:first-child {
|
339 |
+
|
340 |
+
color: #D1D5DB;
|
341 |
+
transition: color 0.3s;
|
342 |
+
}
|
343 |
+
|
344 |
+
.toggleModel:checked+.toggleContainer div:last-child {
|
345 |
+
|
346 |
+
color: #343434;
|
347 |
+
transition: color 0.3s;
|
348 |
+
}
|
349 |
+
|
350 |
+
.toggleModel+.toggleContainer div:first-child {
|
351 |
+
|
352 |
+
color: #343434;
|
353 |
+
transition: color 0.3s;
|
354 |
+
|
355 |
+
}
|
356 |
+
|
357 |
+
.toggleModel+.toggleContainer div:last-child {
|
358 |
+
color: #D1D5DB;
|
359 |
+
transition: color 0.3s;
|
360 |
}
|