denosaurs / wait

🌀 Minimal terminal spinner
https://deno.land/x/wait
MIT License
60 stars 5 forks source link

Property 'consoleSize' does not exist on type 'typeof Deno' #8

Closed tscpp closed 3 years ago

tscpp commented 3 years ago

The package depends on that the '--unstable' flag is enabled. I do not want to enable unstable APIs and until 'Deno.consoleSize' is a stable API the consoleSize should be optional. I think a "try-catch" statement is enough for supporting stable versions.

error: TS2339 [ERROR]: Property 'consoleSize' does not exist on type 'typeof Deno'. 'Deno.consoleSize' is an unstable API. Did you forget to run with the '--unstable' flag?
    const columns = Deno.consoleSize(this.#stream.rid)?.columns || 80;

    at https://deno.land/x/wait@0.1.11/mod.ts:208:26
eliassjogreen commented 3 years ago

I will get to it once i get home from vacation.

eliassjogreen commented 3 years ago

Unless you would like to create a pull request implementing such a feature which would be much appreciated!