mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
24 lines
594 B
TypeScript
24 lines
594 B
TypeScript
import PlainMechanism = require('sasl-plain');
|
|
import { Mechanism } from 'sasl-plain';
|
|
import { Factory } from 'saslmechanisms';
|
|
|
|
new Factory().use(PlainMechanism);
|
|
new Factory().use(Mechanism);
|
|
|
|
// $ExpectType "PLAIN"
|
|
PlainMechanism.prototype.name;
|
|
// $ExpectType true
|
|
PlainMechanism.prototype.clientFirst;
|
|
|
|
const m = new PlainMechanism();
|
|
|
|
// $ExpectType "PLAIN"
|
|
m.name;
|
|
// $ExpectType true
|
|
m.clientFirst;
|
|
// $ExpectType string
|
|
m.response({ username: 'u', password: 'pw' });
|
|
m.response({ username: 'u', password: 'pw', authzid: 'a' });
|
|
// $ExpectType PlainMechanism
|
|
m.challenge('challenge');
|