mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(glur): type definitions for glur (#44410)
- definition files - tests https://www.npmjs.com/package/glur https://github.com/nodeca/glur#api Thanks!
This commit is contained in:
parent
cd8dce9ba2
commit
3095fe0caf
10
types/glur/glur-tests.ts
Normal file
10
types/glur/glur-tests.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import blurRGBA = require('glur');
|
||||
import blurRGBAMono = require('glur/mono16');
|
||||
|
||||
const testRGBA = (src: Uint8Array) => {
|
||||
blurRGBA(src, 100, 100, 50); // $ExpectType void
|
||||
};
|
||||
|
||||
const testMono16 = (src: Uint16Array) => {
|
||||
blurRGBAMono(src, 100, 100, 50); // $ExpectType void
|
||||
};
|
||||
20
types/glur/index.d.ts
vendored
Normal file
20
types/glur/index.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Type definitions for glur 1.1
|
||||
// Project: https://github.com/andr83/glur/issues
|
||||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference types="node" />
|
||||
|
||||
/**
|
||||
* Fast Gaussian Blur in pure JavaScript, via IIR filer.
|
||||
* Speed does not depend on blur radius
|
||||
* @param src - typed array with image RGBA data (will be updated with blurred image)
|
||||
* @param width - image width
|
||||
* @param height - image height
|
||||
* @param radius - blur radius
|
||||
*/
|
||||
declare function blurRGBA(src: Uint8Array, width: number, height: number, radius: number): void;
|
||||
|
||||
/**
|
||||
* Fast gaussian blur in pure JavaScript via IIR filer
|
||||
*/
|
||||
export = blurRGBA;
|
||||
16
types/glur/mono16.d.ts
vendored
Normal file
16
types/glur/mono16.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Fast Gaussian Blur in pure JavaScript, via IIR filer.
|
||||
* Speed does not depend on blur radius
|
||||
* Can be useful to calculate unsharp mask via brightness/lightness channel
|
||||
* @param src - typed array with image grayscale data (will be updated with blurred image)
|
||||
* @param width - image width
|
||||
* @param height - image height
|
||||
* @param radius - blur radius
|
||||
*/
|
||||
declare function blurMono16(src: Uint16Array, width: number, height: number, radius: number): void;
|
||||
|
||||
/**
|
||||
* Fast gaussian blur in pure JavaScript via IIR filer.
|
||||
* Input data is grayscale Uint16Array
|
||||
*/
|
||||
export = blurMono16;
|
||||
23
types/glur/tsconfig.json
Normal file
23
types/glur/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",
|
||||
"glur-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/glur/tslint.json
Normal file
1
types/glur/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user