Menu

API Reference

Exactly the implemented surface — flash.js:1 + src/ ESM. No fake APIs. Verify via flash.d.ts.

Collection

F(selector) returns Collection — iterable, array-like, chainable.

MethodSignatureNotes
getget(i?: number) → Element|Element[]get() all, get(-1) last
eacheach(fn: (i, el)) → thisfn.call(el, i, el)
map / filter / first / last / eq—Returns new Collection / array

F

APIDescription
F(target: string|Element|NodeList|Collection|Window|Document|Function)Selector / HTML string / wrap / ready sugar
F.ready(cb)DOMContentLoaded or immediate
F.version"1.0.0"
F.CollectionClass reference

DOM

MethodSignature
htmlhtml() → string | html(value: string|Element|Collection) → this
texttext() → string | text(value) → this
valval() → string | val(value) → this
addClass / removeClass / toggleClass / hasClassaddClass(...names) → this
attr / removeAttr / prop / removeProp / data / removeDataattr(name, value?), data auto JSON
csscss(prop, value) | css({}) — getter uses getComputedStyle
show / hide / toggleshow(display="") → this
append / prepend / before / after / remove / empty / cloneAccepts string (HTML fragment), Element, Collection
find / parent / parents / children / closest / siblings / next / prev / is / indexTraversal — all return Collection / boolean / number

Events

MethodUsage
onon(events, handler, opts?) or on(events, selector, handler, opts?) delegation
offoff(events?, handler?)
oneone(events, handler) once
triggertrigger(event: string|Event, detail?)

Effects

MethodSignature
animateanimate(keyframes, options?: number|KeyframeAnimationOptions) → Promise<this>
fadeIn / fadeOutfadeIn(duration=300) → Promise
slideDown / slideUpslideDown(duration=300) → Promise
observe / visible / resizeReturns native observer instances

HTTP — F.http

MethodDescription
request(url, options?)fetch + json sugar + timeout via AbortController; throws on !ok with status
json / text / blob / arrayBufferjson(url, options?) → Promise<T>
get / post / put / patch / deleteConvenience wrappers

Storage — F.storage

MethodDescription
get / set / has / remove / clearlocalStorage JSON wrapper
session.*sessionStorage variant

Observers

Collection methods: observe(cb, opts?), visible(cb, opts?), resize(cb, opts?). Standalone via flash.js/observers.

UI — F.toast / modal / alert / confirm / loading

APISignature
toasttoast(message, type|string|{type,duration}) → HTMLElement
modalmodal({ title?, message?, actions: {label,value,variant}[], closeOnBackdrop? }) → Promise<value|null>
alertalert(message, title?) → Promise<true|null>
confirmconfirm(message, title?) → Promise<boolean|null>
loadingloading(show?: boolean) — ref-counted

Utilities — F.copy / download / theme / etc

APISignature
copycopy(text) → Promise<true> clipboard with fallback
downloaddownload(filename, data: Blob|string, mime?)
themetheme(mode?: "light"|"dark"|"system") → string + localStorage + flash:theme event
each / map / filter / extend / unique / toArray / type / isEmptyCollection-agnostic helpers

Full types in flash.d.ts:1. Library is src/index.js:1 + flash.js:1 — imports used by this site are exactly these.

⌕