@graphty/graphty-element / extend / RegisteredFormat
Interface: RegisteredFormat ​
Defined in: graphty-element/src/catalog/formatRegistry.ts:30
One format a third party registered: what a picker reads, and how a file is recognised.
Properties ​
descriptor ​
readonlydescriptor:FormatDescriptor
Defined in: graphty-element/src/catalog/formatRegistry.ts:32
What the catalogue publishes about it.
detect? ​
readonlyoptionaldetect?: (sample) =>boolean
Defined in: graphty-element/src/catalog/formatRegistry.ts:43
Reads the first bytes of a file and says whether this format claims it.
Optional, and asked only after every built-in detector has been asked, so a plugin can claim a file the element could not already read but can never take one a built-in claims. A detector that throws is caught and treated as "no": a sniffer is a guess about somebody else's bytes, and a guess that fails is an answer rather than a failed import.
Parameters ​
sample ​
string
Returns ​
boolean
listGraphs? ​
readonlyoptionallistGraphs?:GraphLister
Defined in: graphty-element/src/catalog/formatRegistry.ts:48
Lists the graphs a file of this format holds. Optional: only a format whose file can hold several declares it, and listGraphs from ./catalog answers null for the rest.
type ​
readonlytype:string
Defined in: graphty-element/src/catalog/formatRegistry.ts:34
The name DataSource.register filed the reader class under. Equal to descriptor.id.