@basis-theory/basis-theory-elements-interfaces
Advanced tools
Comparing version 1.2.0 to 2.0.0
@@ -1,2 +0,1 @@ | ||
export * from './types'; | ||
export * from './styles'; | ||
export {}; |
26
index.js
@@ -5,28 +5,2 @@ "use strict"; | ||
value: true | ||
}); | ||
var _types = require("./types"); | ||
Object.keys(_types).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _types[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _types[key]; | ||
} | ||
}); | ||
}); | ||
var _styles = require("./styles"); | ||
Object.keys(_styles).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _styles[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _styles[key]; | ||
} | ||
}); | ||
}); |
{ | ||
"name": "@basis-theory/basis-theory-elements-interfaces", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"repository": "https://github.com/Basis-Theory/basis-theory-elements-interfaces", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -6,6 +6,66 @@ # Basis Theory Elements Interfaces | ||
The [Basis Theory](https://basistheory.com/) Elements Interfaces exposes common types/constants used for development against the Basis Theory Elements package | ||
This package exposes TypeScript definitions for [Basis Theory JS SDK](https://github.com/Basis-Theory/basis-theory-js) features, including [Elements](https://docs.basistheory.com/elements). | ||
## Documentation | ||
## Installation | ||
For a complete guide with examples, please refer to our [Elements docs](https://docs.basistheory.com/elements). | ||
Using [Node Package Manager](https://docs.npmjs.com/) | ||
```sh | ||
npm install --save-dev @basis-theory/basis-theory-elements-interfaces | ||
``` | ||
Using [Yarn](https://classic.yarnpkg.com/en/docs/) | ||
```sh | ||
yarn add --dev @basis-theory/basis-theory-elements-interfaces | ||
``` | ||
## Usage | ||
Types are exported from the following locations. | ||
### Models | ||
```typescript | ||
import { BasisTheory } from '@basis-theory/basis-theory-js'; | ||
import type { Application } from '@basis-theory/basis-theory-elements-interfaces/models'; // <- models root | ||
const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED'); // replace with your application key | ||
const application: Application = await bt.applications.retrieve('fe1f9ba4-474e-44b9-b949-110cdba9d662'); | ||
``` | ||
### SDK | ||
```typescript | ||
import { BasisTheory } from '@basis-theory/basis-theory-js'; | ||
import type { PaginatedList, ListLogQuery } from '@basis-theory/basis-theory-elements-interfaces/sdk'; // <- sdk root | ||
import type { Log } from '@basis-theory/basis-theory-elements-interfaces/models'; | ||
const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED'); // replace with your application key | ||
let query: ListLogQuery = { | ||
entityType: 'application' | ||
}; | ||
if (someCondition) { | ||
query = { | ||
...query, | ||
entityId: '3f86930c-18f3-4a2d-b033-b738e59d419e' | ||
} | ||
} | ||
const logs: PaginatedList<Log> = await bt.logs.list(query); | ||
``` | ||
### Elements | ||
```typescript | ||
import { BasisTheory } from '@basis-theory/basis-theory-js'; | ||
import type { TextElement } from '@basis-theory/basis-theory-elements-interfaces/elements'; // <- elements root | ||
const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED', { elements: true }); // replace with your application key | ||
const myInput = bt.createElement('text', { targetId: 'myInputId' }); | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
54304
79
1042
71
1