Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions developer/19.0/reference/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ Description
kmc-analyze - keyboard analysis classes, including tools for `&displayMap`<!-- -->.


</td></tr>
<tr><td>

[@keymanapp/kmc-convert](./kmc-convert.md)


</td><td>


</td></tr>
<tr><td>

Expand Down
72 changes: 72 additions & 0 deletions developer/19.0/reference/api/kmc-convert.converter.init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@keymanapp/kmc-convert](./kmc-convert.md) &gt; [Converter](./kmc-convert.converter.md) &gt; [init](./kmc-convert.converter.init.md)

## Converter.init() method

Initialize the converter. Copies options.

**Signature:**

```typescript
init(callbacks: CompilerCallbacks, options: CompilerOptions): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

callbacks


</td><td>

CompilerCallbacks


</td><td>

Callbacks for external interfaces, including message reporting and file io


</td></tr>
<tr><td>

options


</td><td>

CompilerOptions


</td><td>

Compiler options


</td></tr>
</tbody></table>

**Returns:**

Promise&lt;boolean&gt;

false if initialization fails

79 changes: 79 additions & 0 deletions developer/19.0/reference/api/kmc-convert.converter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@keymanapp/kmc-convert](./kmc-convert.md) &gt; [Converter](./kmc-convert.converter.md)

## Converter class

Converts keyboards between different source file formats. The compiler does not read or write from filesystem or network directly, but relies on callbacks for all external IO.

**Signature:**

```typescript
export declare class Converter implements KeymanCompiler
```
**Implements:** KeymanCompiler

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[init(callbacks, options)](./kmc-convert.converter.init.md)


</td><td>


</td><td>

Initialize the converter. Copies options.


</td></tr>
<tr><td>

[run(inputFilename, outputFilename)](./kmc-convert.converter.run.md)


</td><td>


</td><td>

Converts a keyboard source file to another format. Returns an object containing source artifacts on success. The files are passed in by name, and the compiler will use callbacks as passed to the [Converter.init()](./kmc-convert.converter.init.md) function to read any input files by disk.


</td></tr>
<tr><td>

[write(artifacts)](./kmc-convert.converter.write.md)


</td><td>


</td><td>

Write artifacts from a successful compile to disk, via callbacks methods. The artifacts written may include:

- .kmn file - source keyboard used by Keyman on desktop platforms - .kvks file - source on screen keyboard used by Keyman on desktop platforms - .keyman-touch-layout file - source touch layout keyboard for touch platforms - other keyboard source files as implemented


</td></tr>
</tbody></table>

70 changes: 70 additions & 0 deletions developer/19.0/reference/api/kmc-convert.converter.run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@keymanapp/kmc-convert](./kmc-convert.md) &gt; [Converter](./kmc-convert.converter.md) &gt; [run](./kmc-convert.converter.run.md)

## Converter.run() method

Converts a keyboard source file to another format. Returns an object containing source artifacts on success. The files are passed in by name, and the compiler will use callbacks as passed to the [Converter.init()](./kmc-convert.converter.init.md) function to read any input files by disk.

**Signature:**

```typescript
run(inputFilename: string, outputFilename?: string): Promise<ConverterResult>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

inputFilename


</td><td>

string


</td><td>


</td></tr>
<tr><td>

outputFilename


</td><td>

string


</td><td>

_(Optional)_


</td></tr>
</tbody></table>

**Returns:**

Promise&lt;[ConverterResult](./kmc-convert.converterresult.md)<!-- -->&gt;

Source artifacts on success, null on failure.

58 changes: 58 additions & 0 deletions developer/19.0/reference/api/kmc-convert.converter.write.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@keymanapp/kmc-convert](./kmc-convert.md) &gt; [Converter](./kmc-convert.converter.md) &gt; [write](./kmc-convert.converter.write.md)

## Converter.write() method

Write artifacts from a successful compile to disk, via callbacks methods. The artifacts written may include:

- .kmn file - source keyboard used by Keyman on desktop platforms - .kvks file - source on screen keyboard used by Keyman on desktop platforms - .keyman-touch-layout file - source touch layout keyboard for touch platforms - other keyboard source files as implemented

**Signature:**

```typescript
write(artifacts: ConverterArtifacts): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

artifacts


</td><td>

[ConverterArtifacts](./kmc-convert.converterartifacts.md)


</td><td>

object containing artifact data to write out


</td></tr>
</tbody></table>

**Returns:**

Promise&lt;boolean&gt;

true on success

13 changes: 13 additions & 0 deletions developer/19.0/reference/api/kmc-convert.converterartifacts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@keymanapp/kmc-convert](./kmc-convert.md) &gt; [ConverterArtifacts](./kmc-convert.converterartifacts.md)

## ConverterArtifacts interface

**Signature:**

```typescript
export interface ConverterArtifacts extends KeymanCompilerArtifacts
```
**Extends:** KeymanCompilerArtifacts

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@keymanapp/kmc-convert](./kmc-convert.md) &gt; [ConverterOptions](./kmc-convert.converteroptions.md) &gt; [failIfIncomplete](./kmc-convert.converteroptions.failifincomplete.md)

## ConverterOptions.failIfIncomplete property

Fail if the keyboard conversion is not 100% complete

**Signature:**

```typescript
failIfIncomplete?: boolean;
```
59 changes: 59 additions & 0 deletions developer/19.0/reference/api/kmc-convert.converteroptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@keymanapp/kmc-convert](./kmc-convert.md) &gt; [ConverterOptions](./kmc-convert.converteroptions.md)

## ConverterOptions interface

Options for the keyboard converter

**Signature:**

```typescript
export interface ConverterOptions extends CompilerOptions
```
**Extends:** CompilerOptions

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[failIfIncomplete?](./kmc-convert.converteroptions.failifincomplete.md)


</td><td>


</td><td>

boolean


</td><td>

_(Optional)_ Fail if the keyboard conversion is not 100% complete


</td></tr>
</tbody></table>

Loading