mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for sasl-anonymous
This commit is contained in:
parent
e1a9b84984
commit
f225c53dc1
29
types/sasl-anonymous/index.d.ts
vendored
Normal file
29
types/sasl-anonymous/index.d.ts
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Type definitions for sasl-anonymous 0.1
|
||||
// Project: https://github.com/jaredhanson/js-sasl-anonymous
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Mechanism } from 'saslmechanisms';
|
||||
|
||||
export = AnonymousMechanism;
|
||||
|
||||
declare class AnonymousMechanism implements Mechanism {
|
||||
static Mechanism: typeof AnonymousMechanism;
|
||||
static prototype: {
|
||||
name: 'ANONYMOUS';
|
||||
clientFirst: true;
|
||||
};
|
||||
|
||||
name: 'ANONYMOUS';
|
||||
clientFirst: true;
|
||||
|
||||
response(cred: AnonymousMechanism.Credentials): string;
|
||||
|
||||
challenge(chal: string): void;
|
||||
}
|
||||
|
||||
declare namespace AnonymousMechanism {
|
||||
interface Credentials {
|
||||
trace?: string;
|
||||
}
|
||||
}
|
||||
22
types/sasl-anonymous/sasl-anonymous-tests.ts
Normal file
22
types/sasl-anonymous/sasl-anonymous-tests.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import AnonymousMechanism = require('sasl-anonymous');
|
||||
import { Mechanism } from 'sasl-anonymous';
|
||||
import { Factory } from 'saslmechanisms';
|
||||
|
||||
new Factory().use(AnonymousMechanism);
|
||||
new Factory().use(Mechanism);
|
||||
|
||||
// $ExpectType "ANONYMOUS"
|
||||
AnonymousMechanism.prototype.name;
|
||||
// $ExpectType true
|
||||
AnonymousMechanism.prototype.clientFirst;
|
||||
|
||||
const m = new AnonymousMechanism();
|
||||
|
||||
// $ExpectType "ANONYMOUS"
|
||||
m.name;
|
||||
// $ExpectType true
|
||||
m.clientFirst;
|
||||
// $ExpectType string
|
||||
m.response({ trace: 't' });
|
||||
// $ExpectType void
|
||||
m.challenge('challenge');
|
||||
23
types/sasl-anonymous/tsconfig.json
Normal file
23
types/sasl-anonymous/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-anonymous-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/sasl-anonymous/tslint.json
Normal file
1
types/sasl-anonymous/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user