-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
159 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
node_modules | ||
node_modules | ||
index.js | ||
index.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,40 @@ | ||
declare module 'vue-kuzzle' { | ||
import Vue, { PluginFunction } from 'vue'; | ||
export const install: PluginFunction<{}>; | ||
|
||
module 'vue/types/vue' { | ||
interface Vue { | ||
$kuzzle: any; | ||
} | ||
import Vue from 'vue'; | ||
import _Vue from 'vue'; | ||
import { Kuzzle } from 'kuzzle-sdk'; | ||
|
||
declare module 'vue/types/vue' { | ||
interface Vue { | ||
$kuzzle: Kuzzle; | ||
} | ||
} | ||
|
||
export interface Backends { | ||
[name: string]: Backend | ||
} | ||
|
||
export interface Backend { | ||
host: string; | ||
options: { | ||
port: number; | ||
sslConnection: boolean | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* The VueKuzzle plugin. Makes the Kuzzle SDK available in Vue components as | ||
* `this.$kuzzle`. | ||
* | ||
* @param Vue The Vue application to apply the plugin to | ||
* @param options Options passed to the Kuzzle SDK constructor | ||
* | ||
* @see https://docs.kuzzle.io/sdk/js/7/core-classes/kuzzle/constructor/#options | ||
*/ | ||
export declare function VueKuzzle(Vue: typeof _Vue, options: any): void; | ||
|
||
/** | ||
* Instantiates the Kuzzle SDK by resolving the backend from the given config. | ||
* | ||
* @param backendsConfig | ||
* @param sdkOptions | ||
*/ | ||
export declare function instantiateKuzzleSDK(backendsConfig: Backends, sdkOptions: any): Kuzzle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "esnext", | ||
"strict": true, | ||
"importHelpers": true, | ||
"moduleResolution": "node", | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"declaration": false, | ||
"sourceMap": true, | ||
"resolveJsonModule": true, | ||
"baseUrl": ".", | ||
"lib": [ | ||
"esnext", | ||
"dom", | ||
"dom.iterable", | ||
"scripthost" | ||
] | ||
}, | ||
"include": [ | ||
"./index.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// 1. Make sure to import 'vue' before declaring augmented types | ||
import Vue from 'vue'; | ||
import { Kuzzle } from 'kuzzle-sdk'; | ||
|
||
// 2. Specify a file with the types you want to augment | ||
// Vue has the constructor type in types/vue.d.ts | ||
declare module 'vue/types/vue' { | ||
// 3. Declare augmentation for Vue | ||
interface Vue { | ||
$kuzzle: Kuzzle; | ||
} | ||
} |