mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 08:58:23 +08:00
add types of upng-js (#23357)
* add types of upng-js * Update index.d.ts * Update upng-js-tests.ts * Update index.d.ts * Update index.d.ts
This commit is contained in:
20
types/upng-js/index.d.ts
vendored
Normal file
20
types/upng-js/index.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// Type definitions for upng-js 2.1
|
||||
// Project: https://github.com/photopea/UPNG.js
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function decode(buff: ArrayBuffer): PngData;
|
||||
|
||||
export function encode(bufs: ArrayBuffer, width: number, height: number, ps?: number, dels?: any[]): ArrayBuffer;
|
||||
|
||||
export function toRGBA8(out: PngData): ArrayBuffer;
|
||||
|
||||
export interface PngData {
|
||||
width: number;
|
||||
height: number;
|
||||
depth: number;
|
||||
ctype: any;
|
||||
frames: any;
|
||||
tabs: any;
|
||||
data: ArrayBuffer;
|
||||
}
|
||||
23
types/upng-js/tsconfig.json
Normal file
23
types/upng-js/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"upng-js-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/upng-js/tslint.json
Normal file
1
types/upng-js/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
5
types/upng-js/upng-js-tests.ts
Normal file
5
types/upng-js/upng-js-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as UPNG from 'upng-js';
|
||||
|
||||
declare const buff: ArrayBuffer;
|
||||
const img = UPNG.decode(buff);
|
||||
const rgba = UPNG.toRGBA8(img);
|
||||
Reference in New Issue
Block a user