🤖 Merge PR #62168 Added floyd-steinberg types by @tajnymag

* Added floyd-steinberg types

* Changed author name to trigger a new CI run
This commit is contained in:
tajnymag
2022-09-10 08:57:27 +02:00
committed by GitHub
parent 2ec14292a7
commit 55c08b6532
4 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import floydSteinberg = require('floyd-steinberg');
const imageData = new ImageData(new Uint8ClampedArray([]), 1280, 720);
// $ExpectType ImageData
floydSteinberg(imageData);

9
types/floyd-steinberg/index.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
// Type definitions for floyd-steinberg 1.0
// Project: https://github.com/noopkat/floyd-steinberg
// Definitions by: Marek Lukas <https://github.com/tajnymag>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
type ImageDataSubset = Partial<ImageData> & Pick<ImageData, 'width' | 'height' | 'data'>;
declare function floyd_steinberg<T extends ImageDataSubset>(image: T): T;
export = floyd_steinberg;

View File

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

View File

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