From a0083e1862c317a846f36e4a16b67ef37f982f0e Mon Sep 17 00:00:00 2001 From: alice <166900055+alicesaidhi@users.noreply.github.com> Date: Sun, 20 Oct 2024 19:59:41 +0200 Subject: [PATCH] thing --- .pesde/roblox_sync_config_generator.luau | 4 ++ .pesde/sourcemap_generator.luau | 4 ++ pesde.toml | 16 +++++++ scripts/dump_types.py | 2 +- src/create.luau | 3 +- src/init.luau | 53 +++++++++++++++++++++++- src/roblox_types.luau | 31 +++++++++++--- wally.toml | 2 +- 8 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 .pesde/roblox_sync_config_generator.luau create mode 100644 .pesde/sourcemap_generator.luau create mode 100644 pesde.toml diff --git a/.pesde/roblox_sync_config_generator.luau b/.pesde/roblox_sync_config_generator.luau new file mode 100644 index 0000000..c8fe852 --- /dev/null +++ b/.pesde/roblox_sync_config_generator.luau @@ -0,0 +1,4 @@ +local process = require("@lune/process") +local home_dir = if process.os == "windows" then process.env.userprofile else process.env.HOME + +require(home_dir .. "/.pesde/scripts/lune/rojo/roblox_sync_config_generator.luau") \ No newline at end of file diff --git a/.pesde/sourcemap_generator.luau b/.pesde/sourcemap_generator.luau new file mode 100644 index 0000000..d76e3c8 --- /dev/null +++ b/.pesde/sourcemap_generator.luau @@ -0,0 +1,4 @@ +local process = require("@lune/process") +local home_dir = if process.os == "windows" then process.env.userprofile else process.env.HOME + +require(home_dir .. "/.pesde/scripts/lune/rojo/sourcemap_generator.luau") \ No newline at end of file diff --git a/pesde.toml b/pesde.toml new file mode 100644 index 0000000..4aed8e5 --- /dev/null +++ b/pesde.toml @@ -0,0 +1,16 @@ +name = "alicesaidhi/vide" +version = "0.3.1-lite.646" +description = "vide with types" +authors = ["centau"] +repository = "https://github.com/centau/vide" +license = "MIT" + +[target] +environment = "roblox" + +[scripts] +roblox_sync_config_generator = ".pesde/roblox_sync_config_generator.luau" +sourcemap_generator = ".pesde/sourcemap_generator.luau" + +[indices] +default = "https://github.com/daimond113/pesde-index" diff --git a/scripts/dump_types.py b/scripts/dump_types.py index 5de0e7d..830c83c 100644 --- a/scripts/dump_types.py +++ b/scripts/dump_types.py @@ -71,7 +71,7 @@ lines_before = [ "type p ="+space+"T?|()->T", "type e()> ="+space+"T?", "type a={priority:"+space+"number,"+space+"callback:"+space+"(Instance)"+space+"->"+space+"()}", - "type recursive=T|{recursive}" + "type recursive =T|{recursive}" "type c =a|T|Recursive|()->Recursive", "type ContentId = string", # temporary "type Dictionary = {[string]: any}", diff --git a/src/create.luau b/src/create.luau index 4528526..461c419 100644 --- a/src/create.luau +++ b/src/create.luau @@ -54,7 +54,7 @@ local function create(class_or_instance: string|Instance): (Props) -> Instance end type Props = { [any]: any } -return (create :: any) :: +return (create :: any) :: ( (class: "CanvasGroup") -> (r.vCanvasGroup) -> CanvasGroup ) & ( (class: "Frame") -> (r.vFrame) -> Frame ) & ( (class: "ImageButton") -> (r.vImageButton) -> ImageButton ) @@ -102,3 +102,4 @@ return (create :: any) :: & ( (class: "Part") -> (r.vPart) -> Part ) & ( (class: "Model") -> (r.vModel) -> Model ) & ( (class: "MeshPart") -> (r.vMeshPart) -> MeshPart ) +& ( (class: "Highlight") -> (r.vHighlight) -> Highlight ) diff --git a/src/init.luau b/src/init.luau index 8b8529e..8424115 100644 --- a/src/init.luau +++ b/src/init.luau @@ -26,6 +26,7 @@ local action = require(script.action)() local changed = require(script.changed) local throw = require(script.throw) local flags = require(script.flags) +local roblox_types = require(script.roblox_types) export type Source = source.Source export type source = Source @@ -118,7 +119,7 @@ setmetatable(vide :: any, { end }) -return vide +-- TYPES HERE export type vCanvasGroup = roblox_types.vCanvasGroup export type vFrame = roblox_types.vFrame export type vImageButton = roblox_types.vImageButton @@ -166,3 +167,53 @@ export type vCamera = roblox_types.vCamera export type vPart = roblox_types.vPart export type vModel = roblox_types.vModel export type vMeshPart = roblox_types.vMeshPart +export type vHighlight = roblox_types.vHighlight +export type vFrame = roblox_types.vFrame +export type vImageButton = roblox_types.vImageButton +export type vTextButton = roblox_types.vTextButton +export type vImageLabel = roblox_types.vImageLabel +export type vTextLabel = roblox_types.vTextLabel +export type vScrollingFrame = roblox_types.vScrollingFrame +export type vTextBox = roblox_types.vTextBox +export type vVideoFrame = roblox_types.vVideoFrame +export type vViewportFrame = roblox_types.vViewportFrame +export type vBillboardGui = roblox_types.vBillboardGui +export type vScreenGui = roblox_types.vScreenGui +export type vAdGui = roblox_types.vAdGui +export type vSurfaceGui = roblox_types.vSurfaceGui +export type vSelectionBox = roblox_types.vSelectionBox +export type vBoxHandleAdornment = roblox_types.vBoxHandleAdornment +export type vConeHandleAdornment = roblox_types.vConeHandleAdornment +export type vCylinderHandleAdornment = roblox_types.vCylinderHandleAdornment +export type vImageHandleAdornment = roblox_types.vImageHandleAdornment +export type vLineHandleAdornment = roblox_types.vLineHandleAdornment +export type vSphereHandleAdornment = roblox_types.vSphereHandleAdornment +export type vWireframeHandleAdornment = roblox_types.vWireframeHandleAdornment +export type vParabolaAdornment = roblox_types.vParabolaAdornment +export type vSelectionSphere = roblox_types.vSelectionSphere +export type vArcHandles = roblox_types.vArcHandles +export type vHandles = roblox_types.vHandles +export type vSurfaceSelection = roblox_types.vSurfaceSelection +export type vPath2D = roblox_types.vPath2D +export type vUIAspectRatioConstraint = roblox_types.vUIAspectRatioConstraint +export type vUISizeConstraint = roblox_types.vUISizeConstraint +export type vUITextSizeConstraint = roblox_types.vUITextSizeConstraint +export type vUICorner = roblox_types.vUICorner +export type vUIDragDetector = roblox_types.vUIDragDetector +export type vUIFlexItem = roblox_types.vUIFlexItem +export type vUIGradient = roblox_types.vUIGradient +export type vUIListLayout = roblox_types.vUIListLayout +export type vUIGridLayout = roblox_types.vUIGridLayout +export type vUIPageLayout = roblox_types.vUIPageLayout +export type vUITableLayout = roblox_types.vUITableLayout +export type vUIPadding = roblox_types.vUIPadding +export type vUIScale = roblox_types.vUIScale +export type vUIStroke = roblox_types.vUIStroke +export type vWorldModel = roblox_types.vWorldModel +export type vCamera = roblox_types.vCamera +export type vPart = roblox_types.vPart +export type vModel = roblox_types.vModel +export type vMeshPart = roblox_types.vMeshPart +export type vHighlight = roblox_types.vHighlight + +return vide \ No newline at end of file diff --git a/src/roblox_types.luau b/src/roblox_types.luau index 18028ee..6ad6f6f 100644 --- a/src/roblox_types.luau +++ b/src/roblox_types.luau @@ -1,11 +1,10 @@ -type p = T?|()->T -- property -type e()> = T? -- event +type p = T?|()->T +type e()> = T? type a={priority: number, callback: (Instance) -> ()} -type Recursive = T | {Recursive} -type c =a|T|Recursive|()->Recursive +type recursive =T|{recursive}type c =a|T|Recursive|()->Recursive +type ContentId = string type Dictionary = {[string]: any} type Array = {any} - export type vCanvasGroup = { GroupColor3: p, GroupTransparency: p, @@ -1761,5 +1760,27 @@ export type vMeshPart = { Destroying: e<() -> ()>, [number]: c +} +export type vHighlight = { + Adornee: p, + DepthMode: p, + Enabled: p, + FillColor: p, + FillTransparency: p, + OutlineColor: p, + OutlineTransparency: p, + Archivable: p, + Name: p, + Parent: p, + AncestryChanged: e<(child:Instance?,parent:Instance?) -> ()>, + AttributeChanged: e<(attribute:string | number) -> ()>, + Changed: e<(property:string | number) -> ()>, + ChildAdded: e<(child:Instance?) -> ()>, + ChildRemoved: e<(child:Instance?) -> ()>, + DescendantAdded: e<(descendant:Instance?) -> ()>, + DescendantRemoving: e<(descendant:Instance?) -> ()>, + Destroying: e<() -> ()>, + [number]: c + } return{} \ No newline at end of file diff --git a/wally.toml b/wally.toml index 2483da2..3eece77 100644 --- a/wally.toml +++ b/wally.toml @@ -2,7 +2,7 @@ name = "alicesaidhi/vide" description = "Fork of vide, comes with Roblox Instance Types" license = "MIT" -version = "0.3.1-lite.646" +version = "0.3.1-lite.649" registry = "https://github.com/UpliftGames/wally-index" realm = "shared" include = ["default.project.json", "LICENSE", "src"]