Skip to main content

Module search

Module search 

Source
Expand description

Keyword search, filter-panel rules, colour matching and sorting, following Eagle’s behaviour (see the Search and filters chapter of the docs).

Like Eagle, everything is a linear pass over the items; there is no index.

Structs§

Clock
The current time and the start of the local day, in ms since the epoch.
ColorQuery
A colour-search query: the colour and Eagle’s accuracy (5..=40, default 20; lower is stricter).
DateFilter
One date rule of the filter panel (Date Imported, Date Modified).
Filter
The filter panel’s rules. Every active rule must pass.
Query
A parsed search-box query.
SearchScope
Which parts of an item the search box looks at: Eagle’s Search Scope menu. Everything is on by default. An item’s text content, camera and font names are always searched, whatever the scope.
SetFilter
Include/exclude lists for tags or folder ids.

Enums§

DateField
Which timestamp a date rule reads.
DatePreset
Eagle’s date presets. Several selected presets are OR-ed.
DurationUnit
Units of Eagle’s duration fields.
FontFilter
The font filter: activated (installed through Eagle) or not. The sets hold installed_font_keys. Items that are not fonts fail both.
Logic
How the tag and folder filters combine their lists.
OrderBy
Eagle’s orderBy values.
Shape
TextFilter
has / no / keywords for the url and note filters.

Constants§

DAY_MS
One day in milliseconds; Eagle steps days by this, ignoring DST.
TYPE_GROUPS
The type filter’s built-in groups, after the extensions in its list.

Functions§

bpm
An item’s bpm (audio tempo), when it has a non-zero one.
camera
The camera Eagle stored for a RAW photo (rawMetas.camera).
comment_texts
The text of each of an item’s comments (comments[].annotation).
custom_shape_matches
Eagle’s custom W:H shape: the exact ratio, or every item while either side is unset (0).
delta_e00
CIEDE2000 colour difference (kL = kC = kH = 1).
delta_e76
CIE76 colour difference.
distinct_cameras
The camera filter’s options: every distinct camera, sorted as Eagle sorts them (plain code-unit order, so case-sensitive).
distinct_font_families
Every distinct font family, in natural order.
duration
An item’s duration in seconds (audio and video).
duration_range
The shortest and longest duration among items, for the duration fields’ placeholders.
eagle_font_dir
The folder Eagle copies activated fonts into (macOS: ~/Library/Fonts/EagleApp/).
falcon_font_dir
The folder falcon copies the fonts it activates into (macOS: ~/Library/Fonts/Falcon/; on Windows Falcon\Fonts in %LOCALAPPDATA%; elsewhere fonts/Falcon in the user’s data folder, which fontconfig reads). falcon never writes to Eagle’s folder, which the user’s Eagle manages; it only reads it.
folder_index
font_dirs
The folders whose fonts count as activated: Eagle’s and falcon’s.
font_family
The font’s family name (fontMetas.fontFamily).
font_key
The key Eagle looks up to tell whether a font is activated: <postScriptName>_.<ext>.
font_name
First value of one of a font’s fontMetas name maps, such as postScriptName or fontFamily (Eagle takes the first language key).
installed_font_keys
Keys of the activated fonts in dir, built from file names the way Eagle does: <base>_<.ext lower-cased>. The base only loses the extension when the file name ends with the lower-cased form, as with Node’s basename.
installed_font_keys_in
Keys of the activated fonts across dirs (see installed_font_keys): a font in any of them counts as activated.
lab
sRGB to CIELAB (D65), rounded to integers like the color-convert package Eagle uses.
local_day_start
Local midnight at the start of year-month-day, in ms; for building DateFilter::range from a date picker.
local_month
The local (year, month) of a timestamp in ms.
medium
The web-video site of a bookmark (medium: youtube, vimeo, bilibili).
month_counts
How many items fall in each local month, newest month first; the options of a date rule’s month list.
natural_cmp
Case-insensitive comparison with numbers compared by value, like Intl.Collator(..., {numeric: true, sensitivity: 'base'}).
rank_key
A name as Eagle compares it when ranking: decomposed, without combining accents, lower-cased.
rank_names
Ranks names against a typed keyword as Eagle’s tag and folder filter searches and Go to Folder do: the keyword loses its spaces, both sides go through rank_key, names scoring 0 are dropped and the rest are ordered best first (ties keep their order). Returns indices into names. (Eagle also scores the pinyin of Chinese names; falcon does not.)
search_text
search_text_in with every part of the scope on.
search_text_in
The lower-cased text Eagle searches for an item: its text content (text, kept for text files) and camera (rawMetas.camera), then, as scope allows, the name, .ext, url (for queries of two or more characters), note and comments; a font’s full name (the zh entry first, else en) and, for queries of three or more characters, its whole fontMetas as JSON; then tags and the name and description of each folder the item is in.
shape_counts
How many items the Shape filter’s options would find, as Eagle counts them: only items with a width that are not audio or fonts; each falls in one of the five orientations (panoramic ones are not also counted as horizontal or vertical) and at most one of the four ratios.
sort
Sorts items as Eagle does: the key’s own direction (time keys newest first, others ascending), reversed when increase is false. The sort is stable, so ties keep their incoming order.
sort_manual
Sorts items by their hand-arranged order in folder (a folder’s MANUAL sort): order[folder] compared as text, larger first, with modificationTime standing in for items that have no entry, as Eagle does. Reversed when increase is false. Stable.
string_score
How well word matches text by Eagle’s quick-search score (the string_score method): 1 for identical strings, 0 when the letters of word do not all appear in order, otherwise a score rewarding letters that follow each other, start a word or keep their case, and a shared first letter. Lengths and positions are in UTF-16 units, as in JavaScript.
type_counts
How many items each option of the type filter covers: by extension, or by site for web-video bookmarks, as Eagle counts them, plus the font, video and audio groups (which Eagle lists but never counts, so its panel hides them).
type_excluded
Whether one of the type filter’s excluded types covers an item.
type_group
Eagle’s file-type groups for the type filter.
type_included
Whether an item passes the type filter’s included types, in Eagle’s order and with its early answers: its own extension wins; otherwise the first included video or audio group decides by itself (so including both video and audio lets only videos through), a url entry takes bookmarks without a site, a site name its bookmarks, and the Office groups and font follow.
type_options
The type filter’s options: the extensions present, in code-unit order, then the built-in groups not already listed.

Type Aliases§

FolderIndex
Folder id to (name, description).