API / geotoolkit / base
Type Aliases
Variables
Functions
Type Aliases
Ƭ AnyRecord: Record<PropertyKey, unknown>
Any js object with the record-like type
Ƭ CamelToKebabCase<S>: S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "-" : ""}${Lowercase<T>}${CamelToKebabCase<U>}` : S
| Name | Type |
|---|---|
S | extends string |
Ƭ ClassType<T>: Function & { prototype: T }
| Name | Type |
|---|---|
T | any |
Ƭ Constructable<T>: (...args: any) => T
| Name | Type |
|---|---|
T | any |
• (...args)
| Name | Type |
|---|---|
...args | any |
Ƭ Constructor<T>: (...args: any) => T
| Name | Type |
|---|---|
T | any |
• (...args)
| Name | Type |
|---|---|
...args | any |
Ƭ DeepMerge<T, U>: U extends AnyRecord ? T extends AnyRecord ? { [K in keyof U]: K extends keyof T ? DeepMerge<T[K], U[K]> : U[K] } & Omit<T, keyof U> : U : U
Recursively merge types by second type parameter properties substitution
| Name |
|---|
T |
U |
Ƭ DeepPartial<T>: T extends AnyRecord ? { [K in keyof T]?: DeepPartial<T[K]> } : T
Recursively make record properties partial
| Name |
|---|
T |
Ƭ DeepRequired<T>: T extends AnyRecord ? { [K in keyof T]-?: DeepRequired<T[K]> } : T
Recursively make record properties required
| Name |
|---|
T |
Ƭ EmptyRecord: Record<PropertyKey, never>
Empty js object with the record-like type
Ƭ KeysToKebabCase<T>: { [K in keyof T as CamelToKebabCase<string & K>]: T[K] }
Transform keys in CamelCase into kebab-case
| Name |
|---|
T |
Ƭ Merge<T, U>: Omit<T, keyof U> & U
Shallow merge types by properties substitution
Ƭ ToDeepLowercase<T>: T extends AnyRecord ? { [K in string & keyof T as Lowercase<K>]: ToDeepLowercase<T[K]> } : T
Recursively toggle lowercase for the property names.
| Name |
|---|
T |
Ƭ ToLowercase<T>: { [Key in keyof T & string as Lowercase<Key>]: T[Key] }
Toggle lowercase for the property names, one level only.
| Name | Type |
|---|---|
T | extends AnyRecord |
Ƭ ToRecord<T>: { [K in keyof T]: T[K] }
Makes interface, class, etc, looks like Record<,> for the typescript type system
| Name |
|---|
T |
Functions
▸ abstractMethod(): never
This method is used to mark a method, which does not have implementation. By default, it throws exception that method is not implemented.
Throws
when invoked to indicate the method should be overridden.
never
▸ addWatermark(text, color, size): void
| Name | Type |
|---|---|
text | string |
color | string |
size | string |
void
▸ convertCssToCanvas(size): number
Converts css size to canvas size
| Name | Type | Description |
|---|---|---|
size | number | canvas size |
number
▸ createCopy<T>(obj, target?, param?): T
Create copy of the object
| Name | Type |
|---|---|
T | any |
| Name | Type | Description |
|---|---|---|
obj | T | object to copy |
Optional target | T | target |
Optional param | any | param to be passed to copy constructor |
T
a copy of the input object
▸ deepArrayCopy<T>(array, lowercase?): T
Create a deep copy of array
| Name |
|---|
T |
| Name | Type | Description |
|---|---|---|
array | T | array of object or primitive types |
Optional lowercase | boolean | optional parameters to convert properties of object to lower case |
T
a new instance of objects' array
▸ deepMergeObject(options, result?, lowercase?): any
Deep merge object method is the same as mergeObject method , except it supports nested objects.
| Name | Type | Description |
|---|---|---|
options | any | an object to merge properties. |
Optional result | any | Object to merge properties from options |
Optional lowercase | boolean | merge all properties to lower case. if this flag is set then result will have all properties in lower case |
any
▸ dummyMethod(): void
Does nothing. Intended to use as a default implementation of the optional method.
void
▸ enableRenderNativeResolution(enabled): void
Enables render using native resolution
| Name | Type | Description |
|---|---|---|
enabled | boolean | device pixel ratio is set based on this flag |
void
▸ error(...args): void
Print in console error message. Passes on all parameters as passed.
| Name | Type | Description |
|---|---|---|
...args | any[] | a list of objects to output. The string representations of each of these objects are appended together in the order listed and output |
void
▸ getBaseClassName(className): string
Return a base class name if it exists
| Name | Type | Description |
|---|---|---|
className | string | class name |
string
▸ getClassType(className): ClassType<any>
Returns class constructor of the class, which is specified as string with full namespace.
| Name | Type | Description |
|---|---|---|
className | string | class name to get the type for |
ClassType<any>
constructor of the specified type
▸ getFullVersion(): string
Return the current version with full information
string
▸ getObjectClassName(obj): string
Return an object class name
| Name | Type | Description |
|---|---|---|
obj | any | object to return a class name |
string
▸ getPixelScale(): number
Returns pixel scale on current device
number
▸ getResource(moduleName, resourceName): any
Return a resource for the current module and resource name.
Deprecated
since 4.0. Use external storage instead.
| Name | Type | Description |
|---|---|---|
moduleName | string | current module |
resourceName | string | resource name |
any
▸ getVersion(): string
Return the current version
string
▸ implementsInterface(childClass, parentInterface): void
Declares "childClass" to implement "parentInterface"
| Name | Type | Description |
|---|---|---|
childClass | ClassType<any> | child class |
parentInterface | ClassType<any> | parent interface |
void
▸ info(...args): void
Print in console info message. Passes on all parameters as passed.
| Name | Type | Description |
|---|---|---|
...args | any[] | a list of objects to output. The string representations of each of these objects are appended together in the order listed and output |
void
▸ inherits(childClass, parentClass): void
Inherit the prototype methods from one constructor into another. Based on the Closure Library
Deprecated
since 4.0, use standard extends instead
void
▸ init(options): void
initialize modules
| Name | Type | Description |
|---|---|---|
options | Object | options |
Optional options.imports | ClassType<any>[] | modules to init |
void
▸ instantiateClass(className, options?): any
Create instance of the class, which is specified as string with full namespace. This class must have default constructor
| Name | Type | Description |
|---|---|---|
className | string | class name to instantiate |
Optional options | Record<string, any> | optional parameters |
any
instance of the specified type
▸ interfaceCast(childInstance, parentInterface): any
Requests "childClass" for "parentInterface" support
Throws
if parentInterface is not defined
| Name | Type | Description |
|---|---|---|
childInstance | any | child class instance |
parentInterface | string | ClassType<any> | parent interface or its short name |
any
child class instance if "parentInterface" is implemented; null otherwise
▸ isInstanceOf<T>(instance, parentClass): instance is T
Check if instance is a parentClass or implements interface
| Name |
|---|
T |
| Name | Type | Description |
|---|---|---|
instance | unknown | instance to check implementation |
parentClass | string | Constructor<T> | ClassType<T> | parent interface or class |
instance is T
▸ isObjectEmpty(object): boolean
Check if object is empty (has no properties)
| Name | Type | Description |
|---|---|---|
object | any | object to check |
boolean
▸ isRenderNativeResolution(): boolean
Returns true if render native resolution
boolean
▸ log(...args): void
Print in console log message. Passes on all parameters as passed.
| Name | Type | Description |
|---|---|---|
...args | any[] | a list of objects to output. The string representations of each of these objects are appended together in the order listed and output |
void
▸ mergeObjects<T, U>(options, result?, lowercase?, copyUndefinedOptions?): Merge<ToLowercase<ToRecord<T>>, ToRecord<U>>
This method is used to merge properties of two objects from options to results
| Name |
|---|
T |
U |
| Name | Type | Description |
|---|---|---|
options | T | an object to merge properties. |
Optional result | U | Object to merge properties from options. All properties from options are copied to result. If result contains property from options it is replaced. If result has a property and options doesn't have a property the property will be saved in result. |
Optional lowercase | true | merge all properties to lower case. if this flag is set then result will have all properties in lower case |
Optional copyUndefinedOptions | boolean | copy input options with undefined values |
Merge<ToLowercase<ToRecord<T>>, ToRecord<U>>
▸ mergeObjects<T, U>(options, result?, lowercase?, copyUndefinedOptions?): Merge<ToRecord<T>, ToRecord<U>>
This method is used to merge properties of two objects from options to results
| Name |
|---|
T |
U |
| Name | Type | Description |
|---|---|---|
options | T | an object to merge properties. |
Optional result | U | Object to merge properties from options. All properties from options are copied to result. If result contains property from options it is replaced. If result has a property and options doesn't have a property the property will be saved in result. |
Optional lowercase | false | merge all properties to lower case. if this flag is set then result will have all properties in lower case |
Optional copyUndefinedOptions | boolean | copy input options with undefined values |
Merge<ToRecord<T>, ToRecord<U>>
▸ parseFont(font): Object
Utility function to parse inline font string to json object. if the font string is not valid it will return an null object.
| Name | Type |
|---|---|
font | string |
Object
props
props.fontweight font weight (normal, bold, etc.)
props.fontsize font size (ex: 12px)
props.fontfamily font family
props.fontlineheight line height
props.fontstyle font weight (normal, italic, etc.)
| Name | Type |
|---|---|
fontfamily | string |
fontlineheight | string |
fontsize | string |
fontstyle | string |
fontweight | string |
▸ processObjectProperties(object, recursive?): any
Process object in order to return a copy of the object with flat property names. This method doesn't change original object properties
| Name | Type | Description |
|---|---|---|
object | any | object to be processed |
Optional recursive | boolean | is recursive call flag |
any
▸ setClassName(currentClass, className): void
Sets name of the class, which can be retrieved using method getClassName() or toString()
| Name | Type | Description |
|---|---|---|
currentClass | ClassType<any> | class |
className | string | name of the class |
void
▸ setResource(moduleName, resourceName, resource): void
Sets resources
Deprecated
since 4.0. Use external storage instead.
| Name | Type | Description |
|---|---|---|
moduleName | string | module name |
resourceName | string | resource name |
resource | any | resource object |
void
▸ shallowEqual(firstObject, secondObject): boolean
Make shallow comparison of two objects
| Name | Type | Description |
|---|---|---|
firstObject | Record<string, any> | first object to compare |
secondObject | Record<string, any> | second object to compare |
boolean
▸ str2Function(str): Function
Create a function from a string containing the function
Deprecated
since 4.0
| Name | Type | Description |
|---|---|---|
str | string | string to unpack into a function |
Function
func function created from string
▸ toLowerCase(object): Record<string, any>
Converts object to object with properties in lower case
| Name | Type | Description |
|---|---|---|
object | Record<string, any> | object to be processed |
Record<string, any>
object new object (!not modified)
▸ virtualMethod(): void
Specifies a virtual method.
by default, it generates log message when invoked to indicate the method should be overridden.
void
▸ warn(...args): void
Print in console warn message. Passes on all parameters as passed.
| Name | Type | Description |
|---|---|---|
...args | any[] | a list of objects to output. The string representations of each of these objects are appended together in the order listed and output |
void