mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for sasl-external
This commit is contained in:
parent
e1a9b84984
commit
2133ee8e4c
29
types/sasl-external/index.d.ts
vendored
Normal file
29
types/sasl-external/index.d.ts
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Type definitions for sasl-external 0.1
|
||||
// Project: https://github.com/jaredhanson/js-sasl-external
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Mechanism } from 'saslmechanisms';
|
||||
|
||||
export = ExternalMechanism;
|
||||
|
||||
declare class ExternalMechanism implements Mechanism {
|
||||
static Mechanism: typeof ExternalMechanism;
|
||||
static prototype: {
|
||||
name: 'EXTERNAL';
|
||||
clientFirst: true;
|
||||
};
|
||||
|
||||
name: 'EXTERNAL';
|
||||
clientFirst: true;
|
||||
|
||||
response(cred: ExternalMechanism.Credentials): string;
|
||||
|
||||
challenge(chal: string): void;
|
||||
}
|
||||
|
||||
declare namespace ExternalMechanism {
|
||||
interface Credentials {
|
||||
authzid?: string;
|
||||
}
|
||||
}
|
||||
22
types/sasl-external/sasl-external-tests.ts
Normal file
22
types/sasl-external/sasl-external-tests.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import ExternalMechanism = require('sasl-external');
|
||||
import { Mechanism } from 'sasl-external';
|
||||
import { Factory } from 'saslmechanisms';
|
||||
|
||||
new Factory().use(ExternalMechanism);
|
||||
new Factory().use(Mechanism);
|
||||
|
||||
// $ExpectType "EXTERNAL"
|
||||
ExternalMechanism.prototype.name;
|
||||
// $ExpectType true
|
||||
ExternalMechanism.prototype.clientFirst;
|
||||
|
||||
const m = new ExternalMechanism();
|
||||
|
||||
// $ExpectType "EXTERNAL"
|
||||
m.name;
|
||||
// $ExpectType true
|
||||
m.clientFirst;
|
||||
// $ExpectType string
|
||||
m.response({ authzid: 'a' });
|
||||
// $ExpectType void
|
||||
m.challenge('challenge');
|
||||
23
types/sasl-external/tsconfig.json
Normal file
23
types/sasl-external/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"sasl-external-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/sasl-external/tslint.json
Normal file
1
types/sasl-external/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user