question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript typings.

See original GitHub issue

Ok, this is just a snapshot preview, I didn’t exposed method “resizeBuffer”, I didn’t use it, so I do not know what does it returns with Promise.

@puzrin When you see this code, you will be clear what I have done - could you verify if this is ok, at least at first glance?

And in regards “resizeBuffer” method, what is returned with promise (“Result is Promise, resolved with resized rgba buffer” - what is that, which type? String?);

Thanks!

declare module 'pica' {
    export = Pica;
}

declare module 'pica/dist/pica' {
    export = Pica;
}

declare class Pica {

    constructor(configuration?: Configuration);

    public resize(source: HTMLElement, destination: HTMLElement, options: Options): Promise<HTMLCanvasElement>;

    public toBlob(canvas: HTMLCanvasElement, mimeType: string, quality?: number): Promise<Blob>;
}

interface Configuration {
    tile?: number;
    features?: Array<string>;
    idle?: number;
    concurrency?: number;
}

interface Options {
    quality?: number;
    alpha?: boolean;
    unsharpAmount?: number;
    unsharpRadius?: number;
    unsharpThreshold?: number;
    cancelToken?: Promise<any>;
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
denxorzcommented, Aug 1, 2022

If anybody lands here, install: npm i @types/pica --save-dev

Then import: import Pica from 'pica';

Then use:

const pica = Pica();
pica.resize(from, to);
0reactions
puzrincommented, Aug 3, 2018

I think it’s time to close this

Read more comments on GitHub >

github_iconTop Results From Across the Web

typings/typings: *DEPRECATED* The TypeScript Definition ...
Typings is the simple way to manage and install TypeScript definitions. It uses typings.json , which can resolve to the Typings Registry, GitHub,...
Read more >
Documentation - Type Declarations - TypeScript
TypeScript includes declaration files for all of the standardized built-in APIs available in JavaScript runtimes. This includes things like methods and ...
Read more >
Typescript Typings: The Complete Guide: @types Compiler ...
Typescript Typings - The Complete Guide To Type Definitions: @types, Compiler Opt-In Types: When To Use Each and Why?
Read more >
Types of TypeScript typings - Medium
Types of TypeScript typings. A brief overview of the different approaches TypeScript offers to make our React code type safe.
Read more >
Dynamic Static Typing In TypeScript - Smashing Magazine
Dynamic Static Typing In TypeScript · The request object. · The first error is nuanced. · ServerRequest becomes a generic type, as indicated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found