Skip to content

Commit 6e06eba

Browse files
EddyVerbruggenHristo Hristov
authored and
Hristo Hristov
committed
Fixed a bunch of typo's and minor errors in TypeScript definition files. (NativeScript#4707)
* Fix a bunch of typo's and minor errors in TypeScript definition files. * Implemented the requested change by @hshristov
1 parent 121ad5d commit 6e06eba

File tree

17 files changed

+71
-52
lines changed

17 files changed

+71
-52
lines changed

tns-core-modules/application/application.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export var suspendEvent: string;
3232
export var resumeEvent: string;
3333

3434
/**
35-
* String value used when hooking to exitevent.
35+
* String value used when hooking to exit event.
3636
*/
3737
export var exitEvent: string;
3838

@@ -212,7 +212,7 @@ export function on(event: "suspend", callback: (args: ApplicationEventData) => v
212212
export function on(event: "resume", callback: (args: ApplicationEventData) => void, thisArg?: any);
213213

214214
/**
215-
* This event is raised when the Application is about to exitEvent.
215+
* This event is raised when the Application is about to exit.
216216
*/
217217
export function on(event: "exit", callback: (args: ApplicationEventData) => void, thisArg?: any);
218218

@@ -285,7 +285,7 @@ export interface AndroidActivityRequestPermissionsEventData extends AndroidActiv
285285
requestCode: number;
286286

287287
/**
288-
* The Permissions
288+
* The Permissions.
289289
*/
290290
permissions: Array<string>;
291291

@@ -425,7 +425,7 @@ export class AndroidApplication extends Observable {
425425
on(event: "activityBackPressed", callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any);
426426

427427
/**
428-
* This event is raised on the back button is pressed in an android application.
428+
* This event is raised when the Android activity requests permissions.
429429
*/
430430
on(event: "activityRequestPermissions", callback: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any);
431431

tns-core-modules/connectivity/connectivity.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export enum connectionType {
2525
wifi = 1,
2626

2727
/**
28-
* Denotes a mobile connection, i.e. cellular network or WAN
28+
* Denotes a mobile connection, i.e. cellular network or WAN.
2929
*/
3030
mobile = 2
3131
}
3232

3333
/**
3434
* Starts monitoring the connection type.
35-
* @param connectionChangedCallback A function that will be called when the connection type changes.
35+
* @param connectionTypeChangedCallback A function that will be called when the connection type changes.
3636
*/
3737
export function startMonitoring(connectionTypeChangedCallback: (newConnectionType: number) => void): void;
3838

tns-core-modules/file-system/file-system-access.d.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ export class FileSystemAccess {
3838

3939
/**
4040
* Gets all entities of a given path (folder)
41-
* @param onSuccess A callback function to call if operation is successful
41+
* @param path Path to the file.
4242
* @param onError (optional) A callback function to use if any error occurs.
43+
* Returns an array of entities in the folder.
4344
*/
4445
getEntities(path: string, onError?: (error: any) => any): Array<{ path: string; name: string; extension: string }>;
4546

4647
/**
4748
* Performs an action onSuccess for every entity in a folder with a given path.
4849
* Breaks the loop if onSuccess function returns false
50+
* @param path Path to the file.
4951
* @param onEntity A callback function which is called for each entity.
5052
* @param onError (optional) A callback function to use if any error occurs.
5153
*/
@@ -76,7 +78,7 @@ export class FileSystemAccess {
7678
deleteFolder(path: string, onError?: (error: any) => any);
7779

7880
/**
79-
* Deletes a content of a folder with a given path.
81+
* Deletes all content of a folder with a given path.
8082
* @param path Path of the folder.
8183
* @param onError (optional) A callback function to use if any error occurs.
8284
*/
@@ -97,7 +99,7 @@ export class FileSystemAccess {
9799
getDocumentsFolderPath(): string;
98100

99101
/**
100-
* Gets the special documents folder.
102+
* Gets the special temp folder.
101103
* Returns for Android: "/data/data/applicationPackageName/cache", iOS: "/var/mobile/Applications/appID/Library/Caches"
102104
*/
103105
getTempFolderPath(): string;
@@ -116,25 +118,24 @@ export class FileSystemAccess {
116118
/**
117119
* Reads a text from a file with a given path.
118120
* @param path The path to the source file.
119-
* @param onSuccess A callback function which is called when a text is red.
120121
* @param onError (optional) A callback function to use if any error occurs.
121122
* @param encoding (optional) If set reads the text with the specified encoding (default UTF-8).
123+
* Returns the text read.
122124
*/
123125
readText(path: string, onError?: (error: any) => any, encoding?: any): string;
124126

125127
/**
126128
* Reads a binary content from a file with a given path.
127129
* @param path The path to the source file.
128-
* @param onSuccess A callback function which is called when a text is red.
129130
* @param onError (optional) A callback function to use if any error occurs.
131+
* Returns the binary content read.
130132
*/
131133
read(path: string, onError?: (error: any) => any): any;
132134

133135
/**
134136
* Writes a text to a file with a given path.
135137
* @param path The path to the source file.
136138
* @param content The content which will be written to the file.
137-
* @param onSuccess (optional) A callback function which is called when a text is written.
138139
* @param onError (optional) A callback function to use if any error occurs.
139140
* @param encoding (optional) If set writes the text with the specified encoding (default UTF-8).
140141
*/
@@ -144,7 +145,6 @@ export class FileSystemAccess {
144145
* Writes a binary to a file with a given path.
145146
* @param path The path to the source file.
146147
* @param content The content which will be written to the file.
147-
* @param onSuccess (optional) A callback function which is called when a text is written.
148148
* @param onError (optional) A callback function to use if any error occurs.
149149
*/
150150
write(path: string, content: any, onError?: (error: any) => any);
@@ -168,14 +168,17 @@ export class FileSystemAccess {
168168
normalizePath(path: string): string;
169169

170170
/**
171-
* Join two paths (without normalize) only removes some trailing and dublicating path separators.
171+
* Joins two paths (without normalize). Only removes some trailing and duplicate path separators.
172172
* @param left First path to join.
173173
* @param right Second path to join.
174+
* Returns the joined path.
174175
*/
175176
joinPath(left: string, right: string): string;
176177

177178
/**
178179
* Joins an array of file paths.
180+
* @param paths An array of paths.
181+
* Returns the joined path.
179182
*/
180183
joinPaths(paths: string[]): string;
181184
}

tns-core-modules/image-source/image-source.d.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class ImageSource {
1919
width: number;
2020

2121
/**
22-
* Gets or sets the rotation angle that should be applied to image. (Used in android)
22+
* Gets or sets the rotation angle that should be applied to the image. (Used in android)
2323
*/
2424
rotationAngle: number;
2525

@@ -76,13 +76,13 @@ export class ImageSource {
7676
fromData(data: any): Promise<boolean>;
7777

7878
/**
79-
* Loads this instance from the specified native image data.
79+
* Loads this instance from the specified base64 encoded string.
8080
* @param source The Base64 string to load the image from.
8181
*/
8282
loadFromBase64(source: string): boolean;
8383

8484
/**
85-
* Loads this instance from the specified native image data asynchronously.
85+
* Loads this instance from the specified base64 encoded string asynchronously.
8686
* @param source The Base64 string to load the image from.
8787
*/
8888
fromBase64(source: string): Promise<boolean>;
@@ -110,6 +110,10 @@ export class ImageSource {
110110
toBase64String(format: "png" | "jpeg" | "jpg", quality?: number): string;
111111
}
112112

113+
/**
114+
* Creates a new ImageSource instance and loads it from the specified image asset asynchronously.
115+
* @param asset The image asset.
116+
*/
113117
export function fromAsset(asset: imageAssetModule.ImageAsset): Promise<ImageSource>;
114118

115119
/**
@@ -125,14 +129,14 @@ export function fromResource(name: string): ImageSource;
125129
export function fromFile(path: string): ImageSource;
126130

127131
/**
128-
* Creates a new ImageSource instance and loads it from the specified resource name.
132+
* Creates a new ImageSource instance and loads it from the specified native image data.
129133
* @param data The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
130134
*/
131135
export function fromData(data: any): ImageSource;
132136

133137
/**
134-
* Creates a new ImageSource instance and loads it from the specified resource name.
135-
* @param source The Base64 string to load the image from.
138+
* Creates a new ImageSource instance and loads it from the specified base64 encoded string.
139+
* @param source The base64 encoded string to load the image from.
136140
*/
137141
export function fromBase64(source: string): ImageSource;
138142

@@ -150,7 +154,7 @@ export function fromNativeSource(source: any): ImageSource;
150154
export function fromUrl(url: string): Promise<ImageSource>;
151155

152156
/**
153-
* Creates a new ImageSource instance and loads it from the specified local file or resource(if spexified with "res://" prefix)
157+
* Creates a new ImageSource instance and loads it from the specified local file or resource (if specified with the "res://" prefix).
154158
* @param path The location of the file on the file system.
155159
*/
156160
export function fromFileOrResource(path: string): ImageSource;

tns-core-modules/platform/platform.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export interface Device {
4040
model: string;
4141

4242
/**
43-
* Gets the model of the device.
43+
* Gets the OS of the device.
4444
* For example: "Android" or "iOS".
4545
*/
4646
os: string;
@@ -52,32 +52,32 @@ export interface Device {
5252
osVersion: string;
5353

5454
/**
55-
* Gets the OS version.
55+
* Gets the SDK version.
5656
* For example: 19(android), 8.1(ios).
5757
*/
5858
sdkVersion: string;
5959

6060
/**
61-
* Gets the type current device.
62-
* Available values: "phone", "tablet".
61+
* Gets the type of the current device.
62+
* Available values: "Phone", "Tablet".
6363
*/
6464
deviceType: "Phone" | "Tablet";
6565

6666
/**
6767
* Gets the uuid.
68-
* On iOS this will return a new uuid if the application re-installed on the device.
68+
* On iOS this will return a new uuid if the application is re-installed on the device.
6969
* If you need to receive the same uuid even after the application has been re-installed on the device,
7070
* use this plugin: https://www.npmjs.com/package/nativescript-ios-uuid
7171
*/
7272
uuid: string;
7373

7474
/**
75-
* Gets the preferred language. For example "en"
75+
* Gets the preferred language. For example "en" or "en-US".
7676
*/
7777
language: string;
7878

7979
/**
80-
* Gets the preferred region. For example "US"
80+
* Gets the preferred region. For example "US".
8181
*/
8282
region: string;
8383
}
@@ -123,6 +123,6 @@ export module screen {
123123
}
124124

125125
/**
126-
* Gets the current device information
126+
* Gets the current device information.
127127
*/
128128
export var device: Device;

tns-core-modules/ui/gestures/gestures.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export enum GestureTypes {
4444
}
4545

4646
/**
47-
* Defines an enum with supported gesture types.
47+
* Defines an enum with supported gesture states.
4848
*/
4949
export enum GestureStateTypes {
5050
/**
@@ -196,7 +196,7 @@ export interface Pointer {
196196
}
197197

198198
/**
199-
* Provides gesture event data for pinch gesture.
199+
* Provides gesture event data.
200200
*/
201201
export interface GestureEventDataWithState extends GestureEventData {
202202
state: number;

tns-core-modules/ui/html-view/html-view.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class HtmlView extends View {
1919
/**
2020
* Gets the native [UILabel](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UILabel_Class/) that represents the user interface for this component. Valid only when running on iOS.
2121
*/
22-
ios: any /* UILabel */;
22+
ios: any /* UITextView */;
2323

2424
/**
2525
* Gets or sets html string for the HtmlView.

tns-core-modules/ui/image/image.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class Image extends View {
3131
src: any;
3232

3333
/**
34-
* Gets a value indicating if the image is currently loading
34+
* Gets a value indicating if the image is currently loading.
3535
*/
3636
readonly isLoading: boolean;
3737

tns-core-modules/ui/layouts/dock-layout/dock-layout.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import { LayoutBase, View, Property } from "../layout-base";
99
*/
1010
export class DockLayout extends LayoutBase {
1111
/**
12-
* Gets the value of the Left property from a given View.
12+
* Gets the value of the Dock property from a given View.
1313
*/
1414
static getDock(view: View): Dock;
1515

1616
/**
17-
* Sets the value of the Left property from a given View.
17+
* Sets the value of the Dock property from a given View.
1818
*/
1919
static setDock(view: View, value: Dock): void;
2020

tns-core-modules/ui/layouts/grid-layout/grid-layout.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class ItemSpec {
3535
isAuto: boolean;
3636

3737
/**
38-
* Returns true if this ItemSpec instance holds weighted propertion
38+
* Returns true if this ItemSpec instance holds weighted proportion
3939
* of available space.
4040
*/
4141
isStar: boolean;
@@ -107,7 +107,7 @@ export class GridLayout extends LayoutBase {
107107
public removeColumn(itemSpec: ItemSpec): void;
108108

109109
/**
110-
* Removes all columns specification from a GridLayout.
110+
* Removes all column specifications from a GridLayout.
111111
*/
112112
public removeColumns(): void;
113113

@@ -117,7 +117,7 @@ export class GridLayout extends LayoutBase {
117117
public removeRow(itemSpec: ItemSpec): void;
118118

119119
/**
120-
* Removes all rows specification from a GridLayout.
120+
* Removes all row specifications from a GridLayout.
121121
*/
122122
public removeRows(): void;
123123

tns-core-modules/ui/list-view/list-view.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export class ListView extends View {
6161
/**
6262
* A function that returns the appropriate ket template based on the data item.
6363
*/
64-
6564
itemTemplateSelector: string | ((item: any, index: number, items: any) => string);
65+
6666
/**
6767
* Gets or set the items separator line color of the ListView.
6868
*/

tns-core-modules/ui/page/page-common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ backgroundSpanUnderStatusBarProperty.register(PageBase);
324324

325325
/**
326326
* Dependency property used to control if swipe back navigation in iOS is enabled.
327-
* This property is iOS sepecific. Default value: true
327+
* This property is iOS specific. Default value: true
328328
*/
329329
export const enableSwipeBackNavigationProperty = new Property<PageBase, boolean>({ name: "enableSwipeBackNavigation", defaultValue: true, valueConverter: booleanConverter });
330330
enableSwipeBackNavigationProperty.register(PageBase);

tns-core-modules/ui/page/page.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class Page extends ContentView {
104104
public actionBarHidden: boolean;
105105

106106
/**
107-
* Used to control if swipe back navigation in iOS is enabled. This property is iOS sepecific. Default value: true
107+
* Used to control if swipe back navigation in iOS is enabled. This property is iOS specific. Default value: true
108108
*/
109109
public enableSwipeBackNavigation: boolean;
110110

@@ -278,7 +278,7 @@ export const actionBarHiddenProperty: Property<Page, boolean>;
278278

279279
/**
280280
* Dependency property used to control if swipe back navigation in iOS is enabled.
281-
* This property is iOS sepecific. Default value: true
281+
* This property is iOS specific. Default value: true
282282
*/
283283
export const enableSwipeBackNavigationProperty: Property<Page, boolean>;
284284

tns-core-modules/ui/search-bar/search-bar.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class SearchBar extends View {
6868
on(event: "close", callback: (args: EventData) => void, thisArg?: any);
6969

7070
/**
71-
* Hides the soft input method, ususally a soft keyboard.
71+
* Hides the soft input method, usually a soft keyboard.
7272
*/
7373
dismissSoftInput(): void;
7474
}

tns-core-modules/ui/tab-view/tab-view.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,5 @@ export const tabTextColorProperty: CssProperty<Style, Color>;
130130
export const tabBackgroundColorProperty: CssProperty<Style, Color>;
131131
export const selectedTabTextColorProperty: CssProperty<Style, Color>;
132132
export const androidSelectedTabHighlightColorProperty: CssProperty<Style, Color>;
133-
export const androidOffscreenTabLimitProperty: Property<TabView, number>
133+
export const androidOffscreenTabLimitProperty: Property<TabView, number>;
134134
export const iosIconRenderingModeProperty: Property<TabView, "automatic" | "alwaysOriginal" | "alwaysTemplate">;

0 commit comments

Comments
 (0)