Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 18.0 (current version)Version 16.0Version 15.0Version 14.0

On this page

TypedKeymanPackage class

Summary

The TypedKeymanPackage class and its subclasses provide precise typing for the contents of a KeymanPackage.

Syntax

TypedKeymanPackage<TypedLanguageResource>.methodName()

Generic Parameters

TypedLanguageResource: LanguageResource
The type of resource contained within the package. Should be either InstallableKeyboard or InstallableLexicalModel

Description

TypedKeymanPackage is the base class of KeyboardKeymanPackage and LexicalModelKeymanPackage, both of which represent richly-typed parses of their corresponding package files.

Note that the type erasure, KeymanPackage, will often be easier to work with in methods looking to handle both types of packages due to Swift's typing constraints.

Methods and Fields

findResource(withID:) -> TypedLanguageResource?
Returns the resource matching the specified ID, if contained within the package.
installables: [[TypedLanguageResource]]
Returns a list of all resources & language pairings supported by this package.

For KeyboardKeymanPackage, this resolves to [[InstallableKeyboard]], while for LexicalModelKeymanPackage, this resolves to [[InstallableLexicalModel]].
installables(forLanguage: String) -> [TypedLanguageResource]
A language-filtered version of the field above, with the 'language index' dimension dropped.

History

Added in Keyman Engine for iPhone and iPad 14.0.

See Also

KeymanPackage
The base class (and type erasure) for packages.