Skip to content

Commit

Permalink
Update kap-plugin for conf 7 (DefinitelyTyped#46405)
Browse files Browse the repository at this point in the history
1. conf 7 uses #private, which requires Typescript 3.8 and target:
"es2015" or higher.
2. conf 7's get returns `string | undefined`, not `string`, which is
stricter.
3. conf 7's get accepts any `string`, not just the declared property
names, which is less strict.
  • Loading branch information
sandersn committed Jul 28, 2020
1 parent b4a6920 commit 2be3bf4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion types/kap-plugin/index.d.ts
Expand Up @@ -2,7 +2,7 @@
// Project: https://github.com/wulkano/kap/blob/master/docs/plugins.md
// Definitions by: Connor Peet <https://github.com/connor4312>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.2
// Minimum TypeScript Version: 3.8

import * as got from 'got';
import * as ElectronStore from 'electron-store';
Expand Down
3 changes: 1 addition & 2 deletions types/kap-plugin/kap-plugin-tests.ts
Expand Up @@ -20,12 +20,11 @@ const service: KapShareService<Config> = {
greeting: { type: 'string', default: true },
},
action: async context => {
// $ExpectType string
// $ExpectType string | undefined
const name = context.config.get('name');

context.config.get('accessToken');

// $ExpectError
context.config.get('unknown');

await context.request(`https://example.com/greet/${name}`);
Expand Down
1 change: 1 addition & 0 deletions types/kap-plugin/tsconfig.json
Expand Up @@ -4,6 +4,7 @@
"lib": [
"es6"
],
"target": "es2015",
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
Expand Down

0 comments on commit 2be3bf4

Please sign in to comment.