@tsocial/tvweb-sdk-types 0.0.0-beta.20260715-091322
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -0
- package/build/global.d.ts +11 -0
- package/build/index.d.ts +1855 -0
- package/package.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @tsocial/tvweb-sdk-types
|
|
2
|
+
|
|
3
|
+
TypeScript definitions for the **TV Web SDK standalone (UMD) bundle** — the build loaded from the
|
|
4
|
+
CDN via a `<script>` tag and exposed as the global `window.TVWebSDK`.
|
|
5
|
+
|
|
6
|
+
Use this package when you integrate the SDK with a script tag. If you install the SDK from npm
|
|
7
|
+
(`@tsocial/tvweb-sdk`), you do **not** need this package — types ship with the SDK itself.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Install the version that matches your pinned CDN bundle version:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install --save-dev @tsocial/tvweb-sdk-types@5.38.4
|
|
15
|
+
# or
|
|
16
|
+
yarn add --dev @tsocial/tvweb-sdk-types@5.38.4
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Snapshot (beta) bundles have matching types on the `beta` dist-tag.
|
|
20
|
+
|
|
21
|
+
## Setup
|
|
22
|
+
|
|
23
|
+
Add the package to `types` in your `tsconfig.json`:
|
|
24
|
+
|
|
25
|
+
```jsonc
|
|
26
|
+
{
|
|
27
|
+
"compilerOptions": {
|
|
28
|
+
"types": ["@tsocial/tvweb-sdk-types"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That single entry types both the global namespace (`TVWebSDK` / `window.TVWebSDK`) and makes all
|
|
34
|
+
public option/result types importable.
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<script src="https://vision-cdn.trustingsocial.com/tvweb-sdk/5.38.4/build/tvweb-sdk.standalone.min.js"></script>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import type { LivenessDetectionOptions } from '@tsocial/tvweb-sdk-types';
|
|
44
|
+
|
|
45
|
+
const sdk = new window.TVWebSDK.SDK({
|
|
46
|
+
container: document.getElementById('ekyc-container')!,
|
|
47
|
+
lang: 'vi',
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const options: LivenessDetectionOptions = {
|
|
51
|
+
onLivenessDetectionDone: (result) => {
|
|
52
|
+
// fully typed
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
sdk.livenessDetection(options);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Client SDK variants
|
|
59
|
+
|
|
60
|
+
These definitions apply to the base bundle **and every client variant** (`tvweb-sdk.tcb`,
|
|
61
|
+
`tvweb-sdk.msb`, `tvweb-sdk.lotte`, …): all variants expose the same public API under the same
|
|
62
|
+
`TVWebSDK` global.
|
|
63
|
+
|
|
64
|
+
Exception: `tvweb-sdk.dop` (legacy build) exposes a different surface and is not covered.
|
|
65
|
+
|
|
66
|
+
## How it's built
|
|
67
|
+
|
|
68
|
+
`build/index.d.ts` is copied verbatim at build time from the bundled type definitions of
|
|
69
|
+
`@tsocial/tvweb-sdk` (the same file npm consumers use), and `build/global.d.ts` declares the UMD
|
|
70
|
+
global on top of it. The build fails if any `react`/`styled-components` type imports leak into
|
|
71
|
+
the public surface or if a fixture consumer file stops type-checking.
|