Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ platforms
tests
packages/types-android
packages/types-ios
packages/types-minimal
packages/ui-mobile-base
tools/assets/App_Resources
*.cmd
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ We love you and your PR's 🤗. Please follow our [contributing guide](https://g
* Types for iOS
* [@nativescript/types-android](https://github.com/NativeScript/NativeScript/tree/master/packages/types-android)
* Types for Android
* [@nativescript/types-minimal](https://github.com/NativeScript/NativeScript/tree/master/packages/types-minimal)
* 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.
* [@nativescript/ui-mobile-base](https://github.com/NativeScript/NativeScript/tree/master/packages/ui-mobile-base)
* UI mobile base native classes used by core
* [@nativescript/webpack](https://github.com/NativeScript/NativeScript/tree/master/packages/webpack)
Expand Down
1 change: 1 addition & 0 deletions packages/types-ios/src/lib/ios/ios.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
/// <reference path="objc-x86_64/objc!ModelIO.d.ts" />
/// <reference path="objc-x86_64/objc!MultipeerConnectivity.d.ts" />
/// <reference path="objc-x86_64/objc!NativeScriptEmbedder.d.ts" />
/// <reference path="objc-x86_64/objc!NativeScriptUtils.d.ts" />
/// <reference path="objc-x86_64/objc!NaturalLanguage.d.ts" />
/// <reference path="objc-x86_64/objc!NearbyInteraction.d.ts" />
/// <reference path="objc-x86_64/objc!Network.d.ts" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13991,6 +13991,9 @@ declare const NS_UnknownByteOrder: number;

interface _expressionFlags {
_evaluationBlocked: number;
_usesKVC: number;
_validatedExpression: number;
_validatedKeys: number;
_reservedExpressionFlags: number;
}
declare var _expressionFlags: interop.StructType<_expressionFlags>;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

declare class NativeScriptUtils extends NSObject {

static alloc(): NativeScriptUtils; // inherited from NSObject

static createMutableStringForSpanFontColorBackgroundColorTextDecorationBaselineOffset(text: string, font: UIFont, color: UIColor, backgroundColor: UIColor, textDecoration: string, baselineOffset: number): NSMutableAttributedString;

static createMutableStringWithDetails(details: NSDictionary<any, any>): NSMutableAttributedString;

static createUIFont(font: NSDictionary<any, any>): UIFont;

static getImageDataFormatQuality(image: UIImage, format: string, quality: number): NSData;

static getSystemFontWeightItalicSymbolicTraits(size: number, weight: number, italic: boolean, symbolicTraits: number): UIFont;

static new(): NativeScriptUtils; // inherited from NSObject

static scaleImageWidthHeightScaleFactor(image: UIImage, width: number, height: number, scaleFactor: number): UIImage;
}
48 changes: 48 additions & 0 deletions packages/types-ios/src/lib/ios/objc-x86_64/objc!PassKit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1541,3 +1541,51 @@ declare class PKTransitPassProperties extends PKStoredValuePassProperties {

readonly transitBalanceCurrencyCode: string;
}

interface PKVehicleConnectionDelegate extends NSObjectProtocol {

sessionDidChangeConnectionState(newState: PKVehicleConnectionSessionConnectionState): void;

sessionDidReceiveData(data: NSData): void;
}
declare var PKVehicleConnectionDelegate: {

prototype: PKVehicleConnectionDelegate;
};

declare const enum PKVehicleConnectionErrorCode {

Unknown = 0,

SessionUnableToStart = 1,

SessionNotActive = 2
}

declare class PKVehicleConnectionSession extends NSObject {

static alloc(): PKVehicleConnectionSession; // inherited from NSObject

static new(): PKVehicleConnectionSession; // inherited from NSObject

static sessionForPassDelegateCompletion(pass: PKSecureElementPass, delegate: PKVehicleConnectionDelegate, completion: (p1: PKVehicleConnectionSession, p2: NSError) => void): void;

readonly connectionStatus: PKVehicleConnectionSessionConnectionState;

readonly delegate: PKVehicleConnectionDelegate;

invalidate(): void;

sendDataError(message: NSData): boolean;
}

declare const enum PKVehicleConnectionSessionConnectionState {

Disconnected = 0,

Connected = 1,

Connecting = 2,

FailedToConnect = 3
}
4 changes: 4 additions & 0 deletions packages/types-ios/src/lib/ios/objc-x86_64/objc!UIKit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22628,6 +22628,10 @@ declare class UIView extends UIResponder implements CALayerDelegate, NSCoding, U

layoutSubviews(): void;

nativeScriptSetFormattedTextDecorationAndTransform(details: NSDictionary<any, any>): void;

nativeScriptSetTextDecorationAndTransformTextDecorationLetterSpacingLineHeight(text: string, textDecoration: string, letterSpacing: number, lineHeight: number): void;

needsUpdateConstraints(): boolean;

passThroughParent(): boolean;
Expand Down
6 changes: 6 additions & 0 deletions packages/types-ios/src/lib/ios/objc-x86_64/objc!WebKit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,14 @@ declare class WKWebView extends UIView {

readonly loading: boolean;

readonly maximumViewportInset: UIEdgeInsets;

mediaType: string;

readonly microphoneCaptureState: WKMediaCaptureState;

readonly minimumViewportInset: UIEdgeInsets;

navigationDelegate: WKNavigationDelegate;

pageZoom: number;
Expand Down Expand Up @@ -884,6 +888,8 @@ declare class WKWebView extends UIView {

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

setMinimumViewportInsetMaximumViewportInset(minimumViewportInset: UIEdgeInsets, maximumViewportInset: UIEdgeInsets): void;

startDownloadUsingRequestCompletionHandler(request: NSURLRequest, completionHandler: (p1: WKDownload) => void): void;

stopLoading(): void;
Expand Down
3 changes: 3 additions & 0 deletions packages/types-minimal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @nativescript/types-minimal

NativeScript 'Minimal' Types for only the latest Android and iOS sdks.
11 changes: 11 additions & 0 deletions packages/types-minimal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@nativescript/types-minimal",
"version": "8.2.0",
"description": "NativeScript 'Minimal' Types for only the latest Android and iOS sdks.",
"homepage": "https://nativescript.org",
"repository": {
"type": "git",
"url": "https://github.com/NativeScript/NativeScript"
},
"license": "Apache-2.0"
}
16 changes: 16 additions & 0 deletions packages/types-minimal/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"root": "packages/types-minimal",
"sourceRoot": "packages/types-minimal/src",
"projectType": "library",
"generators": {},
"targets": {
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": ["dist/packages"],
"options": {
"commands": ["./tools/scripts/typings-minimal-copy.sh", "mkdir -p dist/packages/types-minimal", "cp -R packages/types-minimal/src/* dist/packages/types-minimal", "cp packages/types-minimal/package.json dist/packages/types-minimal", "cp packages/types-minimal/README.md dist/packages/types-minimal/README.md"],
"parallel": false
}
}
}
}
2 changes: 2 additions & 0 deletions packages/types-minimal/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="./lib/ios/ios.d.ts" />
/// <reference path="./lib/android/android.d.ts" />
3 changes: 3 additions & 0 deletions packages/types-minimal/src/lib/android/android.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference path="./api/android-declarations.d.ts" />
/// <reference path="./api/android-platform-32.d.ts" />
/// <reference path="./api/androidx-32.d.ts" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* tslint:disable:no-unused-variable */
// Android specific TypeScript declarations
declare function float(num: number): any;
declare function long(num: number): any;

/**
* Triggers garbage collection in JavaScript
*/
declare var gc: () => void;

/**
* Releases the reference to the wrapped native object
* @param object The Java object to release.
*/
declare function __releaseNativeCounterpart(object: java.lang.Object): void;

interface ArrayConstructor {
create(type: any, count: number): any;
}

declare module androidNative { export class Array<T> { constructor(); length: number; [index: number]: T; } }

import globalAndroid = android;

Loading