Skip to content

API Reference / @gtkx/codegen / ApiReference

Interface: ApiReference

Defined in: codegen/dist/docs/api-reference.d.ts:85

An index over the GIR data a project's bindings are generated from, queryable and renderable as Markdown.

Accessors

girFiles

Get Signature

get girFiles(): string[]

Defined in: codegen/dist/docs/api-reference.d.ts:110

Paths of the .gir files the index was built from, including the ones pulled in as dependencies.

Returns

string[]

Methods

lookup()

lookup(query, kind?): ApiLookupResult

Defined in: codegen/dist/docs/api-reference.d.ts:118

Resolves a name to a single symbol and renders its reference page. The name may be bare (Button) or qualified (Gtk.Button), and is matched case-insensitively; a name several symbols answer to is reported as ambiguous rather than picked between.

Parameters

query

string

kind?

ApiSymbolKind

Restricts the match to one kind, which is how a class and its JSX element are told apart.

Returns

ApiLookupResult


namespaceOverview()

namespaceOverview(name): string | undefined

Defined in: codegen/dist/docs/api-reference.d.ts:139

Renders one namespace's Markdown page: its import line and its symbol names grouped by kind. The namespace is matched case-insensitively, and an unindexed one yields undefined.

Parameters

name

string

Returns

string | undefined


namespaces()

namespaces(): ApiNamespaceSummary[]

Defined in: codegen/dist/docs/api-reference.d.ts:127

A summary of every indexed namespace, ordered Gtk, Adw, then alphabetically.

Returns

ApiNamespaceSummary[]


overview()

overview(): string

Defined in: codegen/dist/docs/api-reference.d.ts:134

Renders the reference's Markdown landing page: every namespace, its import path, and its totals.

Returns

string


search(options): ApiSymbol[]

Defined in: codegen/dist/docs/api-reference.d.ts:125

Symbols whose name matches the query, best first: an exact name beats a prefix, which beats a substring, and shorter names win ties. An empty query matches nothing.

Parameters

options

ApiSearchOptions

Returns

ApiSymbol[]


symbolNames()

symbolNames(namespaceName): string[]

Defined in: codegen/dist/docs/api-reference.d.ts:132

Sorted names of everything a namespace contributes, JSX elements included. The namespace is matched case-insensitively, and an unindexed one yields an empty array.

Parameters

namespaceName

string

Returns

string[]


symbols()

symbols(query?): ApiSymbol[]

Defined in: codegen/dist/docs/api-reference.d.ts:120

Every indexed symbol the query keeps, ordered by namespace (Gtk, then Adw, then alphabetically) and name.

Parameters

query?

ApiSymbolQuery

Returns

ApiSymbol[]

Released under the MPL-2.0 License.