New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mmrl

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mmrl

A library to make your life easier when working with MMRL's WebUI

latest
npmnpm
Version
0.3.27
Version published
Maintainers
0
Created
Source

MMRL JavaScript Library for WebUI

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.

Table of Contents

  • MMRL JavaScript Library for WebUI

Installation

To install MMRL-V4, clone the repository and install the dependencies:

npm install mmrl

Usage

Types

The types.ts file defines various types used throughout the library:

export type Scope = `$${string}`;
export type ObjectScope = Scope | object;
export type MimeType = `${string}/${string}`;

export interface Manager {
    name: string;
    versionName: string;
    versionCode: number;
}

MMRLObjectAccessor

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";

const accessor = new MMRLObjectAccessor("net-switch");
console.log(accessor.interface);

MMRLInterface

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";

const mmrl = MMRLInterfaceFactory("net-switch");
mmrl.injectStyleSheets();
console.log(mmrl.manager);

FileSystem

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";

const fs = new FileSystem("net-switch");
fs.write("example.txt", "Hello, MMRL!");
const content = fs.read("example.txt");
console.log(content);
fs.delete("example.txt");

VersionInterface

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);

Toast

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";

const toast = Toast.makeText("Hello, MMRL!", Toast.LENGTH_LONG);
toast.show();

FAQs

Package last updated on 14 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts