mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00

* 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; ```
301 lines
8.8 KiB
TypeScript
301 lines
8.8 KiB
TypeScript
|
|
interface NSFileProviderChangeObserver extends NSObjectProtocol {
|
|
|
|
didDeleteItemsWithIdentifiers(deletedItemIdentifiers: NSArray<string> | string[]): void;
|
|
|
|
didUpdateItems(updatedItems: NSArray<NSFileProviderItem> | NSFileProviderItem[]): void;
|
|
|
|
finishEnumeratingChangesUpToSyncAnchorMoreComing(anchor: NSData, moreComing: boolean): void;
|
|
|
|
finishEnumeratingWithError(error: NSError): void;
|
|
}
|
|
declare var NSFileProviderChangeObserver: {
|
|
|
|
prototype: NSFileProviderChangeObserver;
|
|
};
|
|
|
|
declare class NSFileProviderDomain extends NSObject {
|
|
|
|
static alloc(): NSFileProviderDomain; // inherited from NSObject
|
|
|
|
static new(): NSFileProviderDomain; // inherited from NSObject
|
|
|
|
readonly displayName: string;
|
|
|
|
readonly identifier: string;
|
|
|
|
readonly pathRelativeToDocumentStorage: string;
|
|
|
|
constructor(o: { identifier: string; displayName: string; pathRelativeToDocumentStorage: string; });
|
|
|
|
initWithIdentifierDisplayNamePathRelativeToDocumentStorage(identifier: string, displayName: string, pathRelativeToDocumentStorage: string): this;
|
|
}
|
|
|
|
interface NSFileProviderEnumerationObserver extends NSObjectProtocol {
|
|
|
|
didEnumerateItems(updatedItems: NSArray<NSFileProviderItem> | NSFileProviderItem[]): void;
|
|
|
|
finishEnumeratingUpToPage(nextPage: NSData): void;
|
|
|
|
finishEnumeratingWithError(error: NSError): void;
|
|
}
|
|
declare var NSFileProviderEnumerationObserver: {
|
|
|
|
prototype: NSFileProviderEnumerationObserver;
|
|
};
|
|
|
|
interface NSFileProviderEnumerator extends NSObjectProtocol {
|
|
|
|
currentSyncAnchorWithCompletionHandler?(completionHandler: (p1: NSData) => void): void;
|
|
|
|
enumerateChangesForObserverFromSyncAnchor?(observer: NSFileProviderChangeObserver, syncAnchor: NSData): void;
|
|
|
|
enumerateItemsForObserverStartingAtPage(observer: NSFileProviderEnumerationObserver, page: NSData): void;
|
|
|
|
invalidate(): void;
|
|
}
|
|
declare var NSFileProviderEnumerator: {
|
|
|
|
prototype: NSFileProviderEnumerator;
|
|
};
|
|
|
|
declare const enum NSFileProviderErrorCode {
|
|
|
|
NotAuthenticated = -1000,
|
|
|
|
FilenameCollision = -1001,
|
|
|
|
SyncAnchorExpired = -1002,
|
|
|
|
PageExpired = -1002,
|
|
|
|
InsufficientQuota = -1003,
|
|
|
|
ServerUnreachable = -1004,
|
|
|
|
NoSuchItem = -1005,
|
|
|
|
VersionOutOfDate = -1006,
|
|
|
|
DirectoryNotEmpty = -1007
|
|
}
|
|
|
|
declare var NSFileProviderErrorCollidingItemKey: string;
|
|
|
|
declare var NSFileProviderErrorDomain: string;
|
|
|
|
declare var NSFileProviderErrorNonExistentItemIdentifierKey: string;
|
|
|
|
declare class NSFileProviderExtension extends NSObject {
|
|
|
|
static alloc(): NSFileProviderExtension; // inherited from NSObject
|
|
|
|
static new(): NSFileProviderExtension; // inherited from NSObject
|
|
|
|
static placeholderURLForURL(url: NSURL): NSURL;
|
|
|
|
static writePlaceholderAtURLWithMetadataError(placeholderURL: NSURL, metadata: NSDictionary<string, any>): boolean;
|
|
|
|
readonly documentStorageURL: NSURL;
|
|
|
|
readonly domain: NSFileProviderDomain;
|
|
|
|
readonly providerIdentifier: string;
|
|
|
|
URLForItemWithPersistentIdentifier(identifier: string): NSURL;
|
|
|
|
createDirectoryWithNameInParentItemIdentifierCompletionHandler(directoryName: string, parentItemIdentifier: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
|
|
deleteItemWithIdentifierCompletionHandler(itemIdentifier: string, completionHandler: (p1: NSError) => void): void;
|
|
|
|
enumeratorForContainerItemIdentifierError(containerItemIdentifier: string): NSFileProviderEnumerator;
|
|
|
|
fetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler(itemIdentifiers: NSArray<string> | string[], size: CGSize, perThumbnailCompletionHandler: (p1: string, p2: NSData, p3: NSError) => void, completionHandler: (p1: NSError) => void): NSProgress;
|
|
|
|
importDocumentAtURLToParentItemIdentifierCompletionHandler(fileURL: NSURL, parentItemIdentifier: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
|
|
itemChangedAtURL(url: NSURL): void;
|
|
|
|
itemForIdentifierError(identifier: string): NSFileProviderItem;
|
|
|
|
persistentIdentifierForItemAtURL(url: NSURL): string;
|
|
|
|
providePlaceholderAtURLCompletionHandler(url: NSURL, completionHandler: (p1: NSError) => void): void;
|
|
|
|
renameItemWithIdentifierToNameCompletionHandler(itemIdentifier: string, itemName: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
|
|
reparentItemWithIdentifierToParentItemWithIdentifierNewNameCompletionHandler(itemIdentifier: string, parentItemIdentifier: string, newName: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
|
|
setFavoriteRankForItemIdentifierCompletionHandler(favoriteRank: number, itemIdentifier: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
|
|
setLastUsedDateForItemIdentifierCompletionHandler(lastUsedDate: Date, itemIdentifier: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
|
|
setTagDataForItemIdentifierCompletionHandler(tagData: NSData, itemIdentifier: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
|
|
startProvidingItemAtURLCompletionHandler(url: NSURL, completionHandler: (p1: NSError) => void): void;
|
|
|
|
stopProvidingItemAtURL(url: NSURL): void;
|
|
|
|
supportedServiceSourcesForItemIdentifierError(itemIdentifier: string): NSArray<NSFileProviderServiceSource>;
|
|
|
|
trashItemWithIdentifierCompletionHandler(itemIdentifier: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
|
|
untrashItemWithIdentifierToParentItemIdentifierCompletionHandler(itemIdentifier: string, parentItemIdentifier: string, completionHandler: (p1: NSFileProviderItem, p2: NSError) => void): void;
|
|
}
|
|
|
|
declare var NSFileProviderFavoriteRankUnranked: number;
|
|
|
|
declare var NSFileProviderInitialPageSortedByDate: NSData;
|
|
|
|
declare var NSFileProviderInitialPageSortedByName: NSData;
|
|
|
|
interface NSFileProviderItem extends NSObjectProtocol {
|
|
|
|
capabilities?: NSFileProviderItemCapabilities;
|
|
|
|
childItemCount?: number;
|
|
|
|
contentModificationDate?: Date;
|
|
|
|
creationDate?: Date;
|
|
|
|
documentSize?: number;
|
|
|
|
downloaded?: boolean;
|
|
|
|
downloading?: boolean;
|
|
|
|
downloadingError?: NSError;
|
|
|
|
favoriteRank?: number;
|
|
|
|
filename: string;
|
|
|
|
itemIdentifier: string;
|
|
|
|
lastUsedDate?: Date;
|
|
|
|
mostRecentEditorNameComponents?: NSPersonNameComponents;
|
|
|
|
mostRecentVersionDownloaded?: boolean;
|
|
|
|
ownerNameComponents?: NSPersonNameComponents;
|
|
|
|
parentItemIdentifier: string;
|
|
|
|
shared?: boolean;
|
|
|
|
sharedByCurrentUser?: boolean;
|
|
|
|
tagData?: NSData;
|
|
|
|
trashed?: boolean;
|
|
|
|
typeIdentifier: string;
|
|
|
|
uploaded?: boolean;
|
|
|
|
uploading?: boolean;
|
|
|
|
uploadingError?: NSError;
|
|
|
|
userInfo?: NSDictionary<any, any>;
|
|
|
|
versionIdentifier?: NSData;
|
|
}
|
|
declare var NSFileProviderItem: {
|
|
|
|
prototype: NSFileProviderItem;
|
|
};
|
|
|
|
declare const enum NSFileProviderItemCapabilities {
|
|
|
|
AllowsReading = 1,
|
|
|
|
AllowsWriting = 2,
|
|
|
|
AllowsReparenting = 4,
|
|
|
|
AllowsRenaming = 8,
|
|
|
|
AllowsTrashing = 16,
|
|
|
|
AllowsDeleting = 32,
|
|
|
|
AllowsAddingSubItems = 2,
|
|
|
|
AllowsContentEnumerating = 1,
|
|
|
|
AllowsAll = 63
|
|
}
|
|
|
|
interface NSFileProviderItemDecorating extends NSFileProviderItem {
|
|
}
|
|
declare var NSFileProviderItemDecorating: {
|
|
|
|
prototype: NSFileProviderItemDecorating;
|
|
};
|
|
|
|
interface NSFileProviderItemFlags extends NSObjectProtocol {
|
|
|
|
hidden: boolean;
|
|
|
|
pathExtensionHidden: boolean;
|
|
|
|
userExecutable: boolean;
|
|
|
|
userReadable: boolean;
|
|
|
|
userWritable: boolean;
|
|
}
|
|
declare var NSFileProviderItemFlags: {
|
|
|
|
prototype: NSFileProviderItemFlags;
|
|
};
|
|
|
|
declare class NSFileProviderManager extends NSObject {
|
|
|
|
static addDomainCompletionHandler(domain: NSFileProviderDomain, completionHandler: (p1: NSError) => void): void;
|
|
|
|
static alloc(): NSFileProviderManager; // inherited from NSObject
|
|
|
|
static getDomainsWithCompletionHandler(completionHandler: (p1: NSArray<NSFileProviderDomain>, p2: NSError) => void): void;
|
|
|
|
static managerForDomain(domain: NSFileProviderDomain): NSFileProviderManager;
|
|
|
|
static new(): NSFileProviderManager; // inherited from NSObject
|
|
|
|
static placeholderURLForURL(url: NSURL): NSURL;
|
|
|
|
static removeAllDomainsWithCompletionHandler(completionHandler: (p1: NSError) => void): void;
|
|
|
|
static removeDomainCompletionHandler(domain: NSFileProviderDomain, completionHandler: (p1: NSError) => void): void;
|
|
|
|
static writePlaceholderAtURLWithMetadataError(placeholderURL: NSURL, metadata: NSFileProviderItem): boolean;
|
|
|
|
readonly documentStorageURL: NSURL;
|
|
|
|
readonly providerIdentifier: string;
|
|
|
|
static readonly defaultManager: NSFileProviderManager;
|
|
|
|
registerURLSessionTaskForItemWithIdentifierCompletionHandler(task: NSURLSessionTask, identifier: string, completion: (p1: NSError) => void): void;
|
|
|
|
signalEnumeratorForContainerItemIdentifierCompletionHandler(containerItemIdentifier: string, completion: (p1: NSError) => void): void;
|
|
}
|
|
|
|
declare var NSFileProviderRootContainerItemIdentifier: string;
|
|
|
|
interface NSFileProviderServiceSource {
|
|
|
|
serviceName: string;
|
|
|
|
makeListenerEndpointAndReturnError(): NSXPCListenerEndpoint;
|
|
}
|
|
declare var NSFileProviderServiceSource: {
|
|
|
|
prototype: NSFileProviderServiceSource;
|
|
};
|
|
|
|
declare var NSFileProviderWorkingSetContainerItemIdentifier: string;
|