DefinitelyTyped/types/sasl-external/sasl-external-tests.ts
2018-12-05 08:47:52 +01:00

23 lines
533 B
TypeScript

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');