A class that encapsulate platform-specific code. We usually want platform-specific code to be located in a backend, but it may happen that sometimes creating a backend interface is overkill. That's where this comes handy.

Static methods

staticreadStringFromAsset(assetPath:String):String

Read a string from an asset file, synchronously. Warning: not available on every targets

Returns:

String

staticreadBytesFromAsset(assetPath:String):Bytes

Read bytes from an asset file, synchronously. Warning: not available on every targets

Returns:

String

staticgetAssetsPath():String

Returns assets paths on disk (if any) Warning: not available on every targets

Returns:

String

staticgetRtti<T>(c:Class<T>):Classdef

staticinlineresolveElectron():Null<Dynamic>

Available on clay web

staticnodeRequire(module:String):Null<Dynamic>

Available on clay web

staticelectronRemote():Null<Dynamic>

Available on clay web

staticquit():Void

staticrunCeramic(args:Array<String>, callback:(code:Int, stdout:String, stderr:String) ‑> Void):Void

Executes the given Ceramic command asynchronously. This will work only on desktop platforms that have a valid Ceramic installation available. When the app has been launched by Ceramic itself, the same CLI tool will be used. Otherwise, it will look for a ceramic command available in PATH

Parameters:

cmd

The command to run

args

(optional) The command arguments, which will be automatically escaped

callback

The callback, called when the command has finished (or failed)

staticgetEnv(key:String):String

staticisWindows():Bool

staticexec(cmd:String, ?args:Array<String>, callback:(code:Int, stdout:String, stderr:String) ‑> Void):Void

Executes the given command asynchronously

Parameters:

cmd

The command to run

args

(optional) The command arguments, which will be automatically escaped

callback

The callback, called when the command has finished

staticnodeRequire(module:String):Dynamic

Available on headless