@acrolinx/app-sdk
Advanced tools
Comparing version 0.0.3 to 0.0.4
import { TypedEventEmitter } from './event-emitter'; | ||
import { AppButtonConfig, OffsetRange, replaceRanges, selectRanges } from './raw'; | ||
import { AppButtonConfig, OffsetRange, openWindow, replaceRanges, selectRanges } from './raw'; | ||
export { OffsetRange }; | ||
@@ -18,3 +18,4 @@ export declare const DEVELOPMENT_APP_SIGNATURE = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiS2lsbGVyIEFwcCIsImlkIjoiNGVlZDM3NjctMGYzMS00ZDVmLWI2MjktYzg2MWFiM2VkODUyIiwidHlwZSI6IkFQUCIsImlhdCI6MTU2MTE4ODI5M30.zlVJuGITMjAJ2p4nl-qtpj4N0p_8e4tenr-4dkrGdXg"; | ||
selectRanges = "selectRanges", | ||
replaceRanges = "replaceRanges" | ||
replaceRanges = "replaceRanges", | ||
openWindow = "openWindow" | ||
} | ||
@@ -41,2 +42,3 @@ export declare enum ApiEvents { | ||
replaceRanges: typeof replaceRanges; | ||
openWindow: typeof openWindow; | ||
} | ||
@@ -43,0 +45,0 @@ interface AcrolinxAppApi<C extends keyof AppCommands, E extends keyof AppEvents> { |
@@ -38,2 +38,3 @@ "use strict"; | ||
ApiCommands["replaceRanges"] = "replaceRanges"; | ||
ApiCommands["openWindow"] = "openWindow"; | ||
})(ApiCommands = exports.ApiCommands || (exports.ApiCommands = {})); | ||
@@ -63,2 +64,3 @@ var ApiEvents; | ||
replaceRanges: raw_1.replaceRanges, | ||
openWindow: raw_1.openWindow | ||
}; | ||
@@ -65,0 +67,0 @@ var requiredReportLinks = []; |
{ | ||
"name": "@acrolinx/app-sdk", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Acrolinx App SDK", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -5,2 +5,35 @@ # Acrolinx App SDK | ||
## Installation | ||
```bash | ||
npm install @acrolinx/app-sdk | ||
``` | ||
## Example Code | ||
```typescript | ||
import {ApiCommands, ApiEvents, DEVELOPMENT_APP_SIGNATURE, initApi} from '@acrolinx/app-sdk'; | ||
// Initialize the Acrolinx App API | ||
const api = initApi({ | ||
appSignature: DEVELOPMENT_APP_SIGNATURE, | ||
title: 'App Title', | ||
button: { | ||
text: 'Extract Text', | ||
tooltip: 'Extract text from the document' | ||
}, | ||
requiredCommands: [ApiCommands.openWindow], | ||
requiredEvents: [ApiEvents.textExtracted], | ||
}); | ||
// Listen to events | ||
api.events.textExtracted.addEventListener(textExtractedEvent => { | ||
console.log('textExtractedEvent', textExtractedEvent.text, textExtractedEvent.languageId); | ||
}); | ||
// Execute commands | ||
api.commands.openWindow('http://www.acrolinx.com'); | ||
``` | ||
## License | ||
@@ -7,0 +40,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33868
367
55