Skip to content

This project has been discontinued. See TypeSwift/TypeSwift for the next iteration of this project:

License

Notifications You must be signed in to change notification settings

inter-ops/WKTypeScript

Repository files navigation

This project has been archived. For the modern version of this project, see TypeSwift.


Bridge the gap between TypeScript and Swift – a Node.js generator and WebKit extension framework, all in one.

Overview

Declare your functions in TypeScript. Call them, with type-safe parameters, in native Swift.

WKTypeScript allows you to automate and streamline your TypeScript-Swift workflow. Go from declaring code in TypeScript, to implementing them in native Swift – with npm run build in the middle.

Evluate in WebView

webView.ts(.myVar)
webView.ts(.myFunc())
webView.ts(.myCallback(.forSomeVal)) { (result) in
    switch result {
        case success: print("\(success)")
    }
}

Setup

Setup here.

Building

Building here.

Configuration

Config here.

Progress

  • JavaScript type-safe function reference generator for native Swift
  • Create example iOS project
  • Create example macOS project
  • Create cross-platform example project
  • Make a better README working on it

Requirements

Swift

  • iOS 11 or later
  • macOS 10.14 or later