feat!: modo headless, tipos TypeScript, sleep, auto-detecção e demo completa (0.2.0)#9
Merged
NullSablex merged 1 commit intomasterfrom Feb 19, 2026
Merged
feat!: modo headless, tipos TypeScript, sleep, auto-detecção e demo completa (0.2.0)#9NullSablex merged 1 commit intomasterfrom
NullSablex merged 1 commit intomasterfrom
Conversation
…ompleta (0.2.0) BREAKING CHANGE: global UMD renomeado de `CounterUp` (namespace) para `counterUp` (função diretamente). Uso via <script> tag agora é `counterUp(target, options)` em vez de `CounterUp.counterUp(target, options)`. Adicionado: - Modo headless: target `null` executa animação sem DOM (Node.js, SSR, Vitest) - Opção `sleep` (ms): atraso antes da animação, cancelável por stop/pause/destroy - Getter `waiting`: true enquanto o sleep estiver pendente - `end` opcional: lê automaticamente do textContent do elemento - `decimals` inferido do texto do elemento quando omitido - Declarações TypeScript nativas (src/counterup.d.ts): CounterUpOptions, CounterUpInstance, CounterUpGroupInstance, overloads precisos por tipo de target - Seção TypeScript no README com exemplos tipados e tabela de tipos exportados Corrigido: - ReferenceError: requestAnimationFrame (polyfills rAF/cAF) - ReferenceError: document em SSR - TypeError no wrapper UMD (globalThis como fallback primário) - TypeError: textContent of null em headless - setupObserver tentando observe(null) em headless Alterado: - require() CommonJS retorna função diretamente - README reescrito com documentação completa da API - CHANGELOG migrado para português - Demo reescrita com 14 seções e 30+ exemplos ao vivo - Keywords: adicionados typescript, ssr, headless - Versão: 0.1.7 → 0.2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: global UMD renomeado de
CounterUp(namespace) paracounterUp(função diretamente). Uso via <script> tag agora écounterUp(target, options)em vez deCounterUp.counterUp(target, options).Adicionado:
nullexecuta animação sem DOM (Node.js, SSR, Vitest)sleep(ms): atraso antes da animação, cancelável por stop/pause/destroywaiting: true enquanto o sleep estiver pendenteendopcional: lê automaticamente do textContent do elementodecimalsinferido do texto do elemento quando omitidoCounterUpInstance, CounterUpGroupInstance, overloads precisos por tipo de target
Corrigido:
Alterado: