Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
330690a
screen reader
imhoffd Dec 14, 2020
c369ada
action sheet
imhoffd Dec 14, 2020
bdac5e9
more screen reader
imhoffd Dec 14, 2020
b55bcfb
wip
imhoffd Dec 14, 2020
aa4df2b
export all from definitions
imhoffd Dec 14, 2020
69afc8d
motion
imhoffd Dec 14, 2020
88db6f3
toast
imhoffd Dec 14, 2020
f8d2b7b
haptics
imhoffd Dec 14, 2020
8a3700f
more screen reader
imhoffd Dec 14, 2020
4bdd07f
app
imhoffd Dec 14, 2020
d9d6a1d
network
imhoffd Dec 14, 2020
c6dd1fe
app-launcher
imhoffd Dec 14, 2020
c35e73a
wip
imhoffd Dec 14, 2020
3a7e9d3
filesystem
imhoffd Dec 14, 2020
7b91694
browser
imhoffd Dec 14, 2020
6c270e9
text-zoom
imhoffd Dec 14, 2020
90e93f6
status-bar
imhoffd Dec 14, 2020
27410cb
device
imhoffd Dec 14, 2020
682d023
clipboard
imhoffd Dec 14, 2020
b8ee00b
Merge remote-tracking branch 'origin/main' into localize-types
imhoffd Dec 14, 2020
f53c9f1
generate readmes
imhoffd Dec 14, 2020
8a04441
fmt
imhoffd Dec 14, 2020
4b45c36
Merge branch 'main' into localize-types
imhoffd Dec 15, 2020
a502574
update docgen
imhoffd Dec 15, 2020
4a38e02
regen
imhoffd Dec 15, 2020
f082233
Merge branch 'main' into localize-types
imhoffd Dec 16, 2020
5c294cd
Merge branch 'main' into localize-types
imhoffd Dec 16, 2020
4a7205d
Merge branch 'main' into localize-types
imhoffd Dec 19, 2020
a61781e
Merge branch 'main' into localize-types
imhoffd Dec 19, 2020
fbddd6b
geolocation
imhoffd Dec 20, 2020
45c69ac
camera
imhoffd Dec 20, 2020
c57d3fd
splash-screen
imhoffd Dec 20, 2020
ed46fd9
build and format
imhoffd Dec 20, 2020
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
Prev Previous commit
Next Next commit
text-zoom
  • Loading branch information
imhoffd committed Dec 14, 2020
commit 6c270e93b3a98ff07b3c8cac379dd526cef3c8fb
8 changes: 4 additions & 4 deletions text-zoom/src/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface GetResponse {
export interface GetResult {
/**
* The current zoom level (represented as a decimal).
*
Expand All @@ -7,7 +7,7 @@ export interface GetResponse {
value: number;
}

export interface GetPreferredResponse {
export interface GetPreferredResult {
/**
* The preferred zoom level (represented as a decimal).
*
Expand All @@ -33,7 +33,7 @@ export interface TextZoomPlugin {
*
* @since 1.0.0
*/
get(): Promise<GetResponse>;
get(): Promise<GetResult>;

/**
* Get the preferred zoom level.
Expand All @@ -42,7 +42,7 @@ export interface TextZoomPlugin {
*
* @since 1.0.0
*/
getPreferred(): Promise<GetPreferredResponse>;
getPreferred(): Promise<GetPreferredResult>;

/**
* Set the current zoom level.
Expand Down
13 changes: 9 additions & 4 deletions text-zoom/src/ios.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { Plugins } from '@capacitor/core';

import type { TextZoomPlugin } from './definitions';
import type {
GetPreferredResult,
GetResult,
SetOptions,
TextZoomPlugin,
} from './definitions';

export class TextZoomIOS implements TextZoomPlugin {
static readonly TEXT_SIZE_REGEX = /(\d+)%/;

async get(): Promise<{ value: number }> {
async get(): Promise<GetResult> {
const percentage = this.getRaw();
const value = this.textSizePercentageToNumber(percentage);

return { value };
}

async getPreferred(): Promise<{ value: number }> {
async getPreferred(): Promise<GetPreferredResult> {
return Plugins.TextZoom.getPreferred();
}

async set(options: { value: number }): Promise<void> {
async set(options: SetOptions): Promise<void> {
const num = this.textSizeNumberToPercentage(options.value);
this.setRaw(num);
}
Expand Down