mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Add @types for ntlm-client (#42081)
* Add @types/ntlm-client * Remove namespace * Replace import for reference types
This commit is contained in:
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
// Type definitions for ntlm-client 0.1
|
||||
// Project: https://github.com/clncln1/node-ntlm-client
|
||||
// Definitions by: Manuel Borrajo <https://github.com/borrajo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
interface NtlmType2 {
|
||||
flags: number;
|
||||
encoding: string;
|
||||
version: number;
|
||||
challenge: Buffer;
|
||||
targetName: string;
|
||||
targetInfo: {
|
||||
parsed: {
|
||||
DOMAIN: string;
|
||||
SERVER: string;
|
||||
DNS: string;
|
||||
FQDN: string;
|
||||
PARENT_DNS: string;
|
||||
},
|
||||
buffer: Buffer;
|
||||
};
|
||||
}
|
||||
|
||||
declare function createType1Message(workstation: string, domain: string): string;
|
||||
declare function decodeType2Message(type1Message: string): NtlmType2;
|
||||
declare function createType3Message(type2Message: NtlmType2, username: string, password: string, workstation: string, domain: string): string;
|
||||
export { createType1Message, decodeType2Message, createType3Message };
|
||||
@@ -0,0 +1,28 @@
|
||||
import ntlm = require('ntlm-client');
|
||||
|
||||
const type2 = {
|
||||
flags: 0,
|
||||
encoding: '',
|
||||
version: 3,
|
||||
challenge: new Buffer(''),
|
||||
targetName: '',
|
||||
targetInfo: {
|
||||
parsed: {
|
||||
DOMAIN: '',
|
||||
SERVER: '',
|
||||
DNS: '',
|
||||
FQDN: '',
|
||||
PARENT_DNS: '',
|
||||
},
|
||||
buffer: new Buffer(''),
|
||||
}
|
||||
};
|
||||
|
||||
// $ExpectType string
|
||||
ntlm.createType1Message('', '');
|
||||
|
||||
// $ExpectType string
|
||||
ntlm.createType3Message(type2, '', '', '', '');
|
||||
|
||||
// $ExpectType NtlmType2
|
||||
ntlm.decodeType2Message('');
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ntlm-client-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user