Files
Vasil Chimev 3e8d6350b9 feat(platform-declarations): generate typings from iOS 13.0 SDK (#7817)
* feat(platform-declarations): generate typings from iOS 13.0 SDK

* fix(platform-declarations): typings generation script

Delete Material Components typings from `tns-platform-declarations`,
they are part of `tns-core-modules` package.

* refactor(platform-declarations): workaround a TypeScript error

Error:
```
tns-platform-declarations/ios/objc-x86_64/objc!OSLog.d.ts(178,15): error TS2417: Class static side 'typeof OSLogEnumerator' incorrectly extends base class static side 'typeof NSEnumerator'.
  Types of property 'alloc' are incompatible.
    Type '() => OSLogEnumerator' is not assignable to type '<ObjectType>() => NSEnumerator<ObjectType>'.
      Type 'OSLogEnumerator' is not assignable to type 'NSEnumerator<ObjectType>'.
        Types of property 'allObjects' are incompatible.
          Type 'NSArray<NSObject>' is not assignable to type 'NSArray<ObjectType>'.
            Type 'NSObject' is not assignable to type 'ObjectType'.
              'NSObject' is assignable to the constraint of type 'ObjectType', but 'ObjectType' could be instantiated with a different subtype of constraint '{}'.
```

References:
https://github.com/Microsoft/TypeScript/issues/17575
https://stackoverflow.com/questions/52518125/workaround-for-accessing-class-type-arguments-in-static-method-in-typescript

* docs(platform-declarations): note a manual step on generating typings

* chore(platform-declarations): exclude ios-typings-prj from transpilation

* refactor(platform-declarations): delete references to MDC types

```
ios/objc-x86_64/objc!QuartzCore.d.ts:676:36 - error TS2304: Cannot find name 'MDCAnimationTimingFunction'.

676  static mdc_functionWithType(type: MDCAnimationTimingFunction): CAMediaTimingFunction;

ios/objc-x86_64/objc!UIKit.d.ts:7717:54 - error TS2304: Cannot find name 'MDCFontTextStyle'.

7717  static mdc_preferredFontForMaterialTextStyle(style: MDCFontTextStyle): UIFont;

ios/objc-x86_64/objc!UIKit.d.ts:7719:53 - error TS2304: Cannot find name 'MDCFontTextStyle'.

7719  static mdc_standardFontForMaterialTextStyle(style: MDCFontTextStyle): UIFont;

ios/objc-x86_64/objc!UIKit.d.ts:7771:63 - error TS2304: Cannot find name 'MDCFontTextStyle'.

7771  mdc_fontSizedForMaterialTextStyleScaledForDynamicType(style: MDCFontTextStyle, scaled: boolean): UIFont;

ios/objc-x86_64/objc!UIKit.d.ts:7794:64 - error TS2304: Cannot find name 'MDCFontTextStyle'.

7794  static mdc_preferredFontDescriptorForMaterialTextStyle(style: MDCFontTextStyle): UIFontDescriptor;

ios/objc-x86_64/objc!UIKit.d.ts:7796:63 - error TS2304: Cannot find name 'MDCFontTextStyle'.

7796  static mdc_standardFontDescriptorForMaterialTextStyle(style: MDCFontTextStyle): UIFontDescriptor;
```
2019-09-19 22:18:08 +03:00

90 lines
3.4 KiB
TypeScript

interface OS_os_log extends NSObjectProtocol {
}
declare var OS_os_log: {
prototype: OS_os_log;
};
declare var __dso_handle: mach_header;
declare function _os_activity_initiate(dso: interop.Pointer | interop.Reference<any>, description: string, flags: os_activity_flag_t, activity_block: () => void): void;
declare function _os_activity_initiate_f(dso: interop.Pointer | interop.Reference<any>, description: string, flags: os_activity_flag_t, context: interop.Pointer | interop.Reference<any>, _function: interop.FunctionReference<(p1: interop.Pointer | interop.Reference<any>) => void>): void;
declare function _os_activity_label_useraction(dso: interop.Pointer | interop.Reference<any>, name: string): void;
declare function _os_activity_set_breadcrumb(dso: interop.Pointer | interop.Reference<any>, name: string): void;
declare function _os_activity_start(dso: interop.Pointer | interop.Reference<any>, description: string, flags: os_activity_flag_t): number;
declare function _os_log_create(dso: interop.Pointer | interop.Reference<any>, subsystem: string, category: string): NSObject;
declare function _os_log_debug_impl(dso: interop.Pointer | interop.Reference<any>, log: NSObject, type: os_log_type_t, format: string, buf: string, size: number): void;
declare var _os_log_default: void;
declare function _os_log_error_impl(dso: interop.Pointer | interop.Reference<any>, log: NSObject, type: os_log_type_t, format: string, buf: string, size: number): void;
declare function _os_log_fault_impl(dso: interop.Pointer | interop.Reference<any>, log: NSObject, type: os_log_type_t, format: string, buf: string, size: number): void;
declare function _os_log_impl(dso: interop.Pointer | interop.Reference<any>, log: NSObject, type: os_log_type_t, format: string, buf: string, size: number): void;
declare function _os_signpost_emit_with_name_impl(dso: interop.Pointer | interop.Reference<any>, log: NSObject, type: os_signpost_type_t, spid: number, name: string, format: string, buf: string, size: number): void;
declare function os_activity_end(activity: number): void;
declare const enum os_activity_flag_t {
OS_ACTIVITY_FLAG_DEFAULT = 0,
OS_ACTIVITY_FLAG_DETACHED = 1,
OS_ACTIVITY_FLAG_IF_NONE_PRESENT = 2
}
declare function os_activity_get_active(entries: interop.Pointer | interop.Reference<number>, count: interop.Pointer | interop.Reference<number>): number;
declare function os_activity_get_identifier(activity: number, parent_id: interop.Pointer | interop.Reference<number>): number;
interface os_activity_scope_state_s {
opaque: interop.Reference<number>;
}
declare var os_activity_scope_state_s: interop.StructType<os_activity_scope_state_s>;
declare function os_log_create(subsystem: string, category: string): NSObject;
declare function os_log_is_debug_enabled(log: NSObject): boolean;
declare function os_log_is_enabled(log: NSObject): boolean;
declare function os_log_type_enabled(oslog: NSObject, type: os_log_type_t): boolean;
declare const enum os_log_type_t {
OS_LOG_TYPE_DEFAULT = 0,
OS_LOG_TYPE_INFO = 1,
OS_LOG_TYPE_DEBUG = 2,
OS_LOG_TYPE_ERROR = 16,
OS_LOG_TYPE_FAULT = 17
}
declare function os_signpost_enabled(log: NSObject): boolean;
declare function os_signpost_id_generate(log: NSObject): number;
declare function os_signpost_id_make_with_pointer(log: NSObject, ptr: interop.Pointer | interop.Reference<any>): number;
declare const enum os_signpost_type_t {
OS_SIGNPOST_EVENT = 0,
OS_SIGNPOST_INTERVAL_BEGIN = 1,
OS_SIGNPOST_INTERVAL_END = 2
}