Class Host<Query, Resource>
Constructors
constructor
- new Host<Query, Resource>(ffiPolar: Polar, opts: HostOpts): Host<Query, Resource>
-
Type parameters
Parameters
Returns Host<Query, Resource>
Methods
cacheClass
-
Parameters
Returns string
cacheInstance
- cacheInstance(instance: unknown, id?: number): number
-
Parameters
-
instance: unknown
-
Optional id: number
Returns number
externalOp
- externalOp(op: "Eq" | "Geq" | "Gt" | "Leq" | "Lt" | "Neq", leftTerm: PolarTerm, rightTerm: PolarTerm): Promise<boolean>
-
Parameters
-
op: "Eq" | "Geq" | "Gt" | "Leq" | "Lt" | "Neq"
-
-
Returns Promise<boolean>
getInstance
- getInstance(id: number): unknown
-
Parameters
Returns unknown
getType
- getType<Type>(cls?: string | Type): undefined | UserType<Type, any>
-
Type parameters
Parameters
-
Optional cls: string | Type
Returns undefined | UserType<Type, any>
hasInstance
- hasInstance(id: number): boolean
-
Parameters
Returns boolean
isSubclass
- isSubclass(left: string, right: string): boolean
-
Parameters
-
left: string
-
right: string
Returns boolean
isSubspecializer
- isSubspecializer(id: number, left: string, right: string): Promise<boolean>
-
Parameters
-
id: number
-
left: string
-
right: string
Returns Promise<boolean>
isa
- isa(polarInstance: PolarTerm, name: string): Promise<boolean>
-
Parameters
Returns Promise<boolean>
isaWithPath
- isaWithPath(baseTag: string, path: PolarTerm[], classTag: string): Promise<boolean>
-
Parameters
-
baseTag: string
-
-
classTag: string
Returns Promise<boolean>
makeInstance
- makeInstance(name: string, fields: PolarTerm[], id: number): Promise<void>
-
Parameters
Returns Promise<void>
serializeTypes
- serializeTypes(): obj<unknown>
toJs
-
Parameters
Returns Promise<unknown>
Static clone
- clone<Query, Resource>(host: Host<Query, Resource>, opts: Partial<HostOpts>): Host<Query, Resource>
-
Type parameters
Parameters
-
host: Host<Query, Resource>
-
Returns Host<Query, Resource>
Translator between Polar and JavaScript.