Added typing to "ipp" package (#44036)

* Added types for ipp package.

* Changed 'any' to 'object'.

* Added typing for some uneeded functions.

* Format.
This commit is contained in:
filiptypjeu 2020-04-27 15:52:23 +03:00 committed by GitHub
parent 9c865209c8
commit 644162c715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4604 additions and 0 deletions

4511
types/ipp/index.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

69
types/ipp/ipp-tests.ts Normal file
View File

@ -0,0 +1,69 @@
import { Printer } from 'ipp';
// $ExpectError
new Printer();
const printer = new Printer('http://printer.url');
// $ExpectError
printer.execute('not-a-valid-operation');
// $ExpectError
printer.execute('Print-Job', {
'operation-attributes-tag': {
'requesting-user-name': 123,
},
});
// $ExpectError
printer.execute('Print-Job', {
'not-valid-request-options': {},
});
// $ExpectType void
printer.execute('Print-Job');
// $ExpectType void
printer.execute('Print-URI');
// $ExpectType void
printer.execute('Validate-Job');
// $ExpectType void
printer.execute('Create-Job');
// $ExpectType void
printer.execute('Get-Printer-Attributes');
// $ExpectType void
printer.execute('Get-Jobs');
// $ExpectType void
printer.execute('Pause-Printer');
// $ExpectType void
printer.execute('Resume-Printer');
// $ExpectType void
printer.execute('Purge-Jobs');
// $ExpectType void
printer.execute('Send-Document');
// $ExpectType void
printer.execute('Send-URI');
// $ExpectType void
printer.execute('Cancel-Job');
// $ExpectType void
printer.execute('Release-Job');
// $ExpectType void
printer.execute('Get-Job-Attributes');
// $ExpectType void
printer.execute('Hold-Job');
// $ExpectType void
printer.execute('Restart-Job');

23
types/ipp/tsconfig.json Normal file
View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"ipp-tests.ts"
]
}

1
types/ipp/tslint.json Normal file
View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }