@yuno-payments/sdk-web-types 1.23.0 → 2.0.0-beta.1
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 +33 -6
- package/dist/{types.ts → global.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -1,11 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Using Yuno SDK Types
|
|
2
|
+
|
|
3
|
+
This package provides TypeScript types for integrating the Yuno SDK into your application. You can use the types in two ways: **importing them explicitly** or **using them globally**.
|
|
4
|
+
|
|
5
|
+
## 1. Including Types in `tsconfig.json`
|
|
6
|
+
|
|
7
|
+
To make the types available globally across your project, include them in your `tsconfig.json` file:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
"types": ["@yuno-payments/sdk-web-types/dist/global"]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
4
15
|
```
|
|
5
16
|
|
|
6
|
-
##
|
|
17
|
+
## 2. How to Use Types in Your Code
|
|
18
|
+
|
|
19
|
+
### a) **Importing Specific Types**
|
|
20
|
+
|
|
21
|
+
If you prefer to import specific types explicitly, you can do so like this:
|
|
22
|
+
|
|
7
23
|
```typescript
|
|
8
|
-
|
|
24
|
+
import { YunoInstance } from '@yuno-payments/sdk-web-types'
|
|
9
25
|
|
|
10
|
-
|
|
26
|
+
const yunoInstance: YunoInstance = Yuno.initialize('publicApiKey')
|
|
11
27
|
```
|
|
28
|
+
|
|
29
|
+
## 3. What Does the `tsconfig.json` Configuration Do?
|
|
30
|
+
|
|
31
|
+
By including `"types": ["@yuno-payments/sdk-web-types/dist/global"]` in your `tsconfig.json`, **you ensure that global types** (like `Yuno`) are available across your project without the need to import them explicitly.
|
|
32
|
+
|
|
33
|
+
## 🚀 Summary
|
|
34
|
+
|
|
35
|
+
- To use **explicit types**, import the specific types you need from `@yuno-payments/sdk-web-types`.
|
|
36
|
+
- To use **`Yuno` globally**, include the configuration in `tsconfig.json` to make `Yuno` available throughout your project without importing it.
|
|
37
|
+
|
|
38
|
+
With this setup, your Yuno SDK integration will be smooth, and TypeScript's type checking and autocompletion will help you ensure correctness in your code.
|
|
@@ -610,4 +610,4 @@ interface Yuno {
|
|
|
610
610
|
initialize(publicApiKey: string): YunoInstance;
|
|
611
611
|
}
|
|
612
612
|
|
|
613
|
-
|
|
613
|
+
declare const Yuno: Yuno;
|
package/dist/index.d.ts
CHANGED
|
@@ -610,4 +610,4 @@ interface Yuno {
|
|
|
610
610
|
initialize(publicApiKey: string): YunoInstance;
|
|
611
611
|
}
|
|
612
612
|
|
|
613
|
-
|
|
613
|
+
export { type ButtonTextCard, type CardConfig, type CreateArgsSF, type ExternalPaymentButtons, ExternalPaymentButtonsTypes, type FormElementSelector, type Language, type LoadingType, type MountCheckoutArgs, type MountCheckoutLiteArgs, type MountEnrollmentLiteArgs, type MountSeamlessCheckoutLiteArgs, type MountStatusPaymentArgs, type OnChangeDataSF, type RenderMode, type SecureFieldInstance, type SecureFieldsArgs, type StartCheckoutArgs, type TextsCustom, type Yuno, type YunoConfig, type YunoInstance, type mountFraudArgs };
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuno-payments/sdk-web-types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
|
-
"
|
|
6
|
-
"type": "commonjs",
|
|
5
|
+
"type": "module",
|
|
7
6
|
"publishConfig": {
|
|
8
7
|
"access": "public"
|
|
9
8
|
},
|
|
@@ -11,7 +10,7 @@
|
|
|
11
10
|
"/dist"
|
|
12
11
|
],
|
|
13
12
|
"scripts": {
|
|
14
|
-
"build": "rm -rf ./dist && rollup -c
|
|
13
|
+
"build": "rm -rf ./dist && rollup -c && node ./script.js",
|
|
15
14
|
"prepublishOnly": "npm run build",
|
|
16
15
|
"test": "echo \"Error: no test specified\" && exit 0"
|
|
17
16
|
},
|
|
@@ -19,8 +18,8 @@
|
|
|
19
18
|
"license": "ISC",
|
|
20
19
|
"devDependencies": {
|
|
21
20
|
"@types/node": "^20.6.2",
|
|
22
|
-
"rollup": "^
|
|
23
|
-
"rollup-plugin-dts": "^6.
|
|
21
|
+
"rollup": "^4.34.8",
|
|
22
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
24
23
|
"typescript": "^5.2.2"
|
|
25
24
|
}
|
|
26
|
-
}
|
|
25
|
+
}
|