Skip to content

Commit 80e6b81

Browse files
authored
feat(types-minimal): minimal types for only the latest Android and iOS sdks (#9927)
1 parent 81f57dc commit 80e6b81

25 files changed

Lines changed: 247943 additions & 0 deletions

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ platforms
1212
tests
1313
packages/types-android
1414
packages/types-ios
15+
packages/types-minimal
1516
packages/ui-mobile-base
1617
tools/assets/App_Resources
1718
*.cmd

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ We love you and your PR's 🤗. Please follow our [contributing guide](https://g
3838
* Types for iOS
3939
* [@nativescript/types-android](https://github.com/NativeScript/NativeScript/tree/master/packages/types-android)
4040
* Types for Android
41+
* [@nativescript/types-minimal](https://github.com/NativeScript/NativeScript/tree/master/packages/types-minimal)
42+
* A very minimal set of types for only the latest Android and iOS sdks. Most commonly used to optimize Web-based IDE's which auto load all type declarations from node_modules.
4143
* [@nativescript/ui-mobile-base](https://github.com/NativeScript/NativeScript/tree/master/packages/ui-mobile-base)
4244
* UI mobile base native classes used by core
4345
* [@nativescript/webpack](https://github.com/NativeScript/NativeScript/tree/master/packages/webpack)

packages/types-ios/src/lib/ios/ios.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
/// <reference path="objc-x86_64/objc!ModelIO.d.ts" />
9898
/// <reference path="objc-x86_64/objc!MultipeerConnectivity.d.ts" />
9999
/// <reference path="objc-x86_64/objc!NativeScriptEmbedder.d.ts" />
100+
/// <reference path="objc-x86_64/objc!NativeScriptUtils.d.ts" />
100101
/// <reference path="objc-x86_64/objc!NaturalLanguage.d.ts" />
101102
/// <reference path="objc-x86_64/objc!NearbyInteraction.d.ts" />
102103
/// <reference path="objc-x86_64/objc!Network.d.ts" />

packages/types-ios/src/lib/ios/objc-x86_64/objc!Foundation.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13991,6 +13991,9 @@ declare const NS_UnknownByteOrder: number;
1399113991

1399213992
interface _expressionFlags {
1399313993
_evaluationBlocked: number;
13994+
_usesKVC: number;
13995+
_validatedExpression: number;
13996+
_validatedKeys: number;
1399413997
_reservedExpressionFlags: number;
1399513998
}
1399613999
declare var _expressionFlags: interop.StructType<_expressionFlags>;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
declare class NativeScriptUtils extends NSObject {
3+
4+
static alloc(): NativeScriptUtils; // inherited from NSObject
5+
6+
static createMutableStringForSpanFontColorBackgroundColorTextDecorationBaselineOffset(text: string, font: UIFont, color: UIColor, backgroundColor: UIColor, textDecoration: string, baselineOffset: number): NSMutableAttributedString;
7+
8+
static createMutableStringWithDetails(details: NSDictionary<any, any>): NSMutableAttributedString;
9+
10+
static createUIFont(font: NSDictionary<any, any>): UIFont;
11+
12+
static getImageDataFormatQuality(image: UIImage, format: string, quality: number): NSData;
13+
14+
static getSystemFontWeightItalicSymbolicTraits(size: number, weight: number, italic: boolean, symbolicTraits: number): UIFont;
15+
16+
static new(): NativeScriptUtils; // inherited from NSObject
17+
18+
static scaleImageWidthHeightScaleFactor(image: UIImage, width: number, height: number, scaleFactor: number): UIImage;
19+
}

packages/types-ios/src/lib/ios/objc-x86_64/objc!PassKit.d.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,3 +1541,51 @@ declare class PKTransitPassProperties extends PKStoredValuePassProperties {
15411541

15421542
readonly transitBalanceCurrencyCode: string;
15431543
}
1544+
1545+
interface PKVehicleConnectionDelegate extends NSObjectProtocol {
1546+
1547+
sessionDidChangeConnectionState(newState: PKVehicleConnectionSessionConnectionState): void;
1548+
1549+
sessionDidReceiveData(data: NSData): void;
1550+
}
1551+
declare var PKVehicleConnectionDelegate: {
1552+
1553+
prototype: PKVehicleConnectionDelegate;
1554+
};
1555+
1556+
declare const enum PKVehicleConnectionErrorCode {
1557+
1558+
Unknown = 0,
1559+
1560+
SessionUnableToStart = 1,
1561+
1562+
SessionNotActive = 2
1563+
}
1564+
1565+
declare class PKVehicleConnectionSession extends NSObject {
1566+
1567+
static alloc(): PKVehicleConnectionSession; // inherited from NSObject
1568+
1569+
static new(): PKVehicleConnectionSession; // inherited from NSObject
1570+
1571+
static sessionForPassDelegateCompletion(pass: PKSecureElementPass, delegate: PKVehicleConnectionDelegate, completion: (p1: PKVehicleConnectionSession, p2: NSError) => void): void;
1572+
1573+
readonly connectionStatus: PKVehicleConnectionSessionConnectionState;
1574+
1575+
readonly delegate: PKVehicleConnectionDelegate;
1576+
1577+
invalidate(): void;
1578+
1579+
sendDataError(message: NSData): boolean;
1580+
}
1581+
1582+
declare const enum PKVehicleConnectionSessionConnectionState {
1583+
1584+
Disconnected = 0,
1585+
1586+
Connected = 1,
1587+
1588+
Connecting = 2,
1589+
1590+
FailedToConnect = 3
1591+
}

packages/types-ios/src/lib/ios/objc-x86_64/objc!UIKit.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22628,6 +22628,10 @@ declare class UIView extends UIResponder implements CALayerDelegate, NSCoding, U
2262822628

2262922629
layoutSubviews(): void;
2263022630

22631+
nativeScriptSetFormattedTextDecorationAndTransform(details: NSDictionary<any, any>): void;
22632+
22633+
nativeScriptSetTextDecorationAndTransformTextDecorationLetterSpacingLineHeight(text: string, textDecoration: string, letterSpacing: number, lineHeight: number): void;
22634+
2263122635
needsUpdateConstraints(): boolean;
2263222636

2263322637
passThroughParent(): boolean;

packages/types-ios/src/lib/ios/objc-x86_64/objc!WebKit.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,10 +800,14 @@ declare class WKWebView extends UIView {
800800

801801
readonly loading: boolean;
802802

803+
readonly maximumViewportInset: UIEdgeInsets;
804+
803805
mediaType: string;
804806

805807
readonly microphoneCaptureState: WKMediaCaptureState;
806808

809+
readonly minimumViewportInset: UIEdgeInsets;
810+
807811
navigationDelegate: WKNavigationDelegate;
808812

809813
pageZoom: number;
@@ -884,6 +888,8 @@ declare class WKWebView extends UIView {
884888

885889
setMicrophoneCaptureStateCompletionHandler(state: WKMediaCaptureState, completionHandler: () => void): void;
886890

891+
setMinimumViewportInsetMaximumViewportInset(minimumViewportInset: UIEdgeInsets, maximumViewportInset: UIEdgeInsets): void;
892+
887893
startDownloadUsingRequestCompletionHandler(request: NSURLRequest, completionHandler: (p1: WKDownload) => void): void;
888894

889895
stopLoading(): void;

packages/types-minimal/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @nativescript/types-minimal
2+
3+
NativeScript 'Minimal' Types for only the latest Android and iOS sdks.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@nativescript/types-minimal",
3+
"version": "8.2.0",
4+
"description": "NativeScript 'Minimal' Types for only the latest Android and iOS sdks.",
5+
"homepage": "https://nativescript.org",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/NativeScript/NativeScript"
9+
},
10+
"license": "Apache-2.0"
11+
}

0 commit comments

Comments
 (0)