Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 92e9d4d

Browse filesBrowse files
committed
Revert "chore: trick to get Typings to work correctly. Application event object was using ApplicationCommon | Observable which is not compatible with Observable. Rendering Observable optional with OptionalAll did the trick"
This reverts commit 573f81f.
1 parent 573f81f commit 92e9d4d
Copy full SHA for 92e9d4d

File tree

Expand file treeCollapse file tree

5 files changed

+13
-13
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+13
-13
lines changed

‎packages/core/application/application-interfaces.ts

Copy file name to clipboardExpand all lines: packages/core/application/application-interfaces.ts
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { ApplicationCommon } from './application-common';
22
import type { EventData, Observable } from '../data/observable';
33
import type { View } from '../ui/core/view';
4-
import { OptionalAll } from '../utils/typescript-utils';
54

65
/**
76
* An extended JavaScript Error which will have the nativeError property initialized in case the error is caused by executing platform-specific code.
@@ -43,7 +42,7 @@ export interface ApplicationEventData {
4342
/**
4443
* The instance that has raised the event.
4544
*/
46-
object: ApplicationCommon | OptionalAll<Observable>;
45+
object: ApplicationCommon | Observable;
4746
}
4847

4948
/**
@@ -213,7 +212,7 @@ export interface LoadAppCSSEventData extends ApplicationEventData {
213212
/**
214213
* Data for the Android dialog fragment onCreateView event.
215214
*/
216-
export interface AndroidDialogFragmentOnCreateViewEventData extends ApplicationEventData {
215+
export interface AndroidDialogFragmentOnCreateViewEventData {
217216
/**
218217
* The name of the event.
219218
*/
@@ -227,6 +226,11 @@ export interface AndroidDialogFragmentOnCreateViewEventData extends ApplicationE
227226
* Gets native dialog
228227
*/
229228
dialog?: any; // AndroidApplication;
229+
230+
/**
231+
* The instance that has raised the event.
232+
*/
233+
object: ApplicationCommon | Observable;
230234
}
231235

232236
/**

‎packages/core/data/observable/index.ts

Copy file name to clipboardExpand all lines: packages/core/data/observable/index.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Optional, OptionalAll } from '../../utils/typescript-utils';
1+
import { Optional } from '../../utils/typescript-utils';
22

33
/**
44
* Base event data.
55
*/
6-
export interface EventData<T = OptionalAll<Observable>> {
6+
export interface EventData<T = Observable> {
77
/**
88
* The name of the event.
99
*/
@@ -36,7 +36,7 @@ export interface PropertyChangeData<T = Observable> extends EventData<T> {
3636
oldValue?: any;
3737
}
3838

39-
interface ListenerEntry<T = OptionalAll<Observable>> {
39+
interface ListenerEntry<T = Observable> {
4040
callback: (data: EventData<T>) => void;
4141
thisArg: any;
4242
once?: boolean;

‎packages/core/file-system/index.d.ts

Copy file name to clipboardExpand all lines: packages/core/file-system/index.d.ts
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,14 @@ export class Folder extends FileSystemEntity {
257257
/**
258258
* Gets or creates a File entity with the specified name within this Folder.
259259
* @param name The name of the file to get/create.
260-
* @param create create the file if not existing (default to true)
261260
*/
262-
getFile(name: string, create?: boolean): File;
261+
getFile(name: string): File;
263262

264263
/**
265264
* Gets or creates a Folder entity with the specified name within this Folder.
266265
* @param name The name of the folder to get/create.
267-
* @param create create the file if not existing (default to true)
268266
*/
269-
getFolder(name: string, create?: boolean): Folder;
267+
getFolder(name: string): Folder;
270268

271269
/**
272270
* Gets all the top-level entities residing within this folder.

‎packages/core/ui/core/weak-event-listener/index.ts

Copy file name to clipboardExpand all lines: packages/core/ui/core/weak-event-listener/index.ts
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Observable, EventData } from '../../../data/observable';
2-
import { OptionalAll } from '../../../utils/typescript-utils';
32

43
const handlersForEventName = new Map<string, (eventData: EventData) => void>();
5-
const sourcesMap = new WeakMap<OptionalAll<Observable>, Map<string, Array<TargetHandlerPair>>>();
4+
const sourcesMap = new WeakMap<Observable, Map<string, Array<TargetHandlerPair>>>();
65

76
class TargetHandlerPair {
87
tagetRef: WeakRef<Object>;

‎packages/core/utils/typescript-utils.d.ts

Copy file name to clipboardExpand all lines: packages/core/utils/typescript-utils.d.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
* // returns: { eventName: string; object?: Observable }
55
*/
66
export type Optional<T, K extends keyof T> = Omit<T, K> & { [P in K]?: T[P] };
7-
export type OptionalAll<T> = { [P in K]?: T[P] };

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.