mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
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:
parent
9c865209c8
commit
644162c715
4511
types/ipp/index.d.ts
vendored
Normal file
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
69
types/ipp/ipp-tests.ts
Normal 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
23
types/ipp/tsconfig.json
Normal 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
1
types/ipp/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user