Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: add types for v5 api #4

Open
wants to merge 1 commit into
base: v5
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions src/launcher.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
declare module "getid-launcher" {
declare const init: (
containerId: string,
skdKey: string,
originCfg: PageSideConfig,
...args: any
) => void

interface Profile {
category: string
value: string
}

interface Metadata {
externalId: string
labels: object
}

interface PageSideConfig {
apiUrl: string
sdkKey?: string
apiKey?: string
jwt?: string
containerId?: string
flow?: any
flowName?: string
metadata?: Metadata
mode?: "popup" | "inline"
onFail?: (code: string) => void
onComplete?: (result: { id: string; responseCode: number }) => void
profile?: Profile[]
locale?: string
customerId?: string
injectCSS?: string
htmlProperties?: {
disableSwitchDevice: bool
disableSwitchLocales: bool
isPopUp: bool
}
}

interface getLinkScriptResponse {
responseCode: 400 | 200
message?: string
scriptLink?: string
}

interface GetidWebSdk {
init: (config: object) => void
}

declare global {
interface Window {
getidWebSdk: GetidWebSdk
}
}

export { PageSideConfig, getLinkScriptResponse, init }
}