This is a JavaScript library designed to provide an interface for interacting with the MMRL environment. It includes classes and types to facilitate the integration and manipulation of MMRL objects.
To install MMRL-V4, clone the repository and install the dependencies:
npm install mmrlThe types.ts file defines various types used throughout the library:
exporttypeScope= `$${string}`;exporttypeObjectScope=Scope|object;exporttypeMimeType= `${string}/${string}`;exportinterfaceManager{name: string;versionName: string;versionCode: number;}The MMRLObjectAccessor class provides a base class for accessing MMRL objects. It handles the parsing of the scope and provides utility methods for interacting with the MMRL environment.
Example usage:
import{MMRLObjectAccessor}from"mmrl";constaccessor=newMMRLObjectAccessor("net-switch");console.log(accessor.interface);The MMRLInterface class extends MMRLObjectAccessor to provide additional functionality specific to MMRL. It includes methods for injecting stylesheets, accessing manager information, and interacting with the MMRL environment.
Example usage:
import{MMRLInterfaceFactory}from"mmrl";constmmrl=MMRLInterfaceFactory("net-switch");mmrl.injectStyleSheets();console.log(mmrl.manager);The FileSystem class provides methods for interacting with the file system within the MMRL environment. It includes methods for reading, writing, and deleting files.
Example usage:
import{FileSystem}from"mmrl";constfs=newFileSystem("net-switch");fs.write("example.txt","Hello, MMRL!");constcontent=fs.read("example.txt");console.log(content);fs.delete("example.txt");The VersionInterface class provides access to version information about the MMRL environment. It includes properties for application and root configuration details.
Example usage:
import{mmrl}from"mmrl";console.log(mmrl.app.versionName);console.log(mmrl.root.platform);The Toast class provides methods for creating and displaying native toast notifications within the MMRL environment. It includes methods for setting text, duration, gravity, and showing or canceling the toast.
Example usage:
import{Toast}from"mmrl";consttoast=Toast.makeText("Hello, MMRL!",Toast.LENGTH_LONG);toast.show();