Skip to content

An experimental and incomplete Roblox-TS implementation of the Reflect Metadata API.

Notifications You must be signed in to change notification settings

cmumme/Roblox-TS-Reflect-Metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Experimental Reflect

An experimental and incomplete Roblox-TS implementation of the Reflect Metadata API.

Declarative Syntax:

import { Reflect } from "@rbxts/experimental-reflect"

class MyClass {
    @Reflect.metadata("custom:MyMetadata", "This is the metadata for MyProperty.")
    public MyProperty = "Hello, world!"
}

const MyClassInstance = new MyClass()

print(Reflect.getMetadata("custom:MyMetadata", MyClassInstance, "MyProperty")) // Expected output: "This is the metadata for MyProperty."

Imperative Syntax:

import { Reflect } from "@rbxts/experimental-reflect"

class MyClass {
    public MyProperty = "Hello, world!"

    public constructor() {
        Reflect.defineMetadata("custom:MyMetadata", "This is the metadata for MyProperty.", this, "MyProperty")
    }
}

const MyClassInstance = new MyClass()

print(Reflect.getMetadata("custom:MyMetadata", MyClassInstance, "MyProperty")) // Expected output: "This is the metadata for MyProperty."

About

An experimental and incomplete Roblox-TS implementation of the Reflect Metadata API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published