@rbxts/centurion-ui 1.0.0-dev-284510d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/out/app/app.d.ts +6 -0
  2. package/out/app/app.lua +83 -0
  3. package/out/app/index.d.ts +1 -0
  4. package/out/app/init.lua +7 -0
  5. package/out/app/terminal-app.d.ts +1 -0
  6. package/out/app/terminal-app.lua +61 -0
  7. package/out/components/history/history-line.d.ts +10 -0
  8. package/out/components/history/history-line.lua +63 -0
  9. package/out/components/history/history-list.d.ts +15 -0
  10. package/out/components/history/history-list.lua +62 -0
  11. package/out/components/history/index.d.ts +1 -0
  12. package/out/components/history/init.lua +7 -0
  13. package/out/components/index.d.ts +1 -0
  14. package/out/components/init.lua +7 -0
  15. package/out/components/suggestions/badge.d.ts +16 -0
  16. package/out/components/suggestions/badge.lua +52 -0
  17. package/out/components/suggestions/index.d.ts +1 -0
  18. package/out/components/suggestions/init.lua +7 -0
  19. package/out/components/suggestions/main-suggestion.d.ts +12 -0
  20. package/out/components/suggestions/main-suggestion.lua +180 -0
  21. package/out/components/suggestions/suggestion-list.d.ts +8 -0
  22. package/out/components/suggestions/suggestion-list.lua +70 -0
  23. package/out/components/suggestions/suggestions.d.ts +1 -0
  24. package/out/components/suggestions/suggestions.lua +117 -0
  25. package/out/components/suggestions/types.d.ts +6 -0
  26. package/out/components/suggestions/types.lua +2 -0
  27. package/out/components/suggestions/util.d.ts +4 -0
  28. package/out/components/suggestions/util.lua +72 -0
  29. package/out/components/terminal-text-field.d.ts +11 -0
  30. package/out/components/terminal-text-field.lua +289 -0
  31. package/out/components/terminal-window.d.ts +1 -0
  32. package/out/components/terminal-window.lua +265 -0
  33. package/out/components/terminal.d.ts +1 -0
  34. package/out/components/terminal.lua +26 -0
  35. package/out/components/ui/frame.d.ts +20 -0
  36. package/out/components/ui/frame.lua +29 -0
  37. package/out/components/ui/group.d.ts +17 -0
  38. package/out/components/ui/group.lua +24 -0
  39. package/out/components/ui/layer.d.ts +7 -0
  40. package/out/components/ui/layer.lua +23 -0
  41. package/out/components/ui/outline.d.ts +14 -0
  42. package/out/components/ui/outline.lua +106 -0
  43. package/out/components/ui/padding.d.ts +10 -0
  44. package/out/components/ui/padding.lua +19 -0
  45. package/out/components/ui/scrolling-frame.d.ts +15 -0
  46. package/out/components/ui/scrolling-frame.lua +42 -0
  47. package/out/components/ui/shortcut-group.d.ts +6 -0
  48. package/out/components/ui/shortcut-group.lua +100 -0
  49. package/out/components/ui/text-field.d.ts +13 -0
  50. package/out/components/ui/text-field.lua +53 -0
  51. package/out/components/ui/text.d.ts +20 -0
  52. package/out/components/ui/text.lua +55 -0
  53. package/out/constants/options.d.ts +2 -0
  54. package/out/constants/options.lua +19 -0
  55. package/out/constants/springs.d.ts +19 -0
  56. package/out/constants/springs.lua +20 -0
  57. package/out/constants/text.d.ts +3 -0
  58. package/out/constants/text.lua +9 -0
  59. package/out/constants/util.d.ts +1 -0
  60. package/out/constants/util.lua +7 -0
  61. package/out/hooks/use-motion.d.ts +4 -0
  62. package/out/hooks/use-motion.lua +24 -0
  63. package/out/hooks/use-px.d.ts +24 -0
  64. package/out/hooks/use-px.lua +56 -0
  65. package/out/hooks/use-store.d.ts +3 -0
  66. package/out/hooks/use-store.lua +7 -0
  67. package/out/index.d.ts +2 -0
  68. package/out/init.lua +10 -0
  69. package/out/palette.d.ts +56 -0
  70. package/out/palette.lua +51 -0
  71. package/out/providers/api-provider.d.ts +8 -0
  72. package/out/providers/api-provider.lua +17 -0
  73. package/out/providers/options-provider.d.ts +13 -0
  74. package/out/providers/options-provider.lua +39 -0
  75. package/out/providers/root-provider.d.ts +11 -0
  76. package/out/providers/root-provider.lua +24 -0
  77. package/out/store/app/app-selectors.d.ts +2 -0
  78. package/out/store/app/app-selectors.lua +7 -0
  79. package/out/store/app/app-slice.d.ts +8 -0
  80. package/out/store/app/app-slice.lua +17 -0
  81. package/out/store/app/index.d.ts +2 -0
  82. package/out/store/app/init.lua +10 -0
  83. package/out/store/command/command-selectors.d.ts +2 -0
  84. package/out/store/command/command-selectors.lua +7 -0
  85. package/out/store/command/command-slice.d.ts +15 -0
  86. package/out/store/command/command-slice.lua +21 -0
  87. package/out/store/command/index.d.ts +2 -0
  88. package/out/store/command/init.lua +10 -0
  89. package/out/store/history/history-slice.d.ts +11 -0
  90. package/out/store/history/history-slice.lua +52 -0
  91. package/out/store/history/index.d.ts +1 -0
  92. package/out/store/history/init.lua +7 -0
  93. package/out/store/index.d.ts +46 -0
  94. package/out/store/init.lua +18 -0
  95. package/out/store/suggestion/index.d.ts +2 -0
  96. package/out/store/suggestion/init.lua +10 -0
  97. package/out/store/suggestion/suggestion-selectors.d.ts +2 -0
  98. package/out/store/suggestion/suggestion-selectors.lua +7 -0
  99. package/out/store/suggestion/suggestion-slice.d.ts +9 -0
  100. package/out/store/suggestion/suggestion-slice.lua +15 -0
  101. package/out/store/text/index.d.ts +2 -0
  102. package/out/store/text/init.lua +10 -0
  103. package/out/store/text/text-selectors.d.ts +3 -0
  104. package/out/store/text/text-selectors.lua +11 -0
  105. package/out/store/text/text-slice.d.ts +20 -0
  106. package/out/store/text/text-slice.lua +29 -0
  107. package/out/types.d.ts +40 -0
  108. package/out/types.lua +2 -0
  109. package/out/util/argument.d.ts +2 -0
  110. package/out/util/argument.lua +26 -0
  111. package/out/util/suggestion.d.ts +4 -0
  112. package/out/util/suggestion.lua +208 -0
  113. package/package.json +54 -0
@@ -0,0 +1,11 @@
1
+ import { Signal } from "@rbxts/beacon";
2
+ import { ClientAPI } from "@rbxts/centurion";
3
+ import React from "@rbxts/react";
4
+ import { InterfaceOptions } from "../types";
5
+ interface RootProviderProps extends React.PropsWithChildren {
6
+ api: ClientAPI;
7
+ options: InterfaceOptions;
8
+ optionsChanged: Signal<[options: Partial<InterfaceOptions>]>;
9
+ }
10
+ export declare function RootProvider({ api, options, optionsChanged, children, }: RootProviderProps): JSX.Element;
11
+ export {};
@@ -0,0 +1,24 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local ReflexProvider = TS.import(script, TS.getModule(script, "@rbxts", "react-reflex")).ReflexProvider
5
+ local store = TS.import(script, script.Parent.Parent, "store").store
6
+ local ApiProvider = TS.import(script, script.Parent, "api-provider").ApiProvider
7
+ local OptionsProvider = TS.import(script, script.Parent, "options-provider").OptionsProvider
8
+ local function RootProvider(_param)
9
+ local api = _param.api
10
+ local options = _param.options
11
+ local optionsChanged = _param.optionsChanged
12
+ local children = _param.children
13
+ return React.createElement(ReflexProvider, {
14
+ producer = store,
15
+ }, React.createElement(ApiProvider, {
16
+ api = api,
17
+ }, React.createElement(OptionsProvider, {
18
+ value = options,
19
+ changed = optionsChanged,
20
+ }, children)))
21
+ end
22
+ return {
23
+ RootProvider = RootProvider,
24
+ }
@@ -0,0 +1,2 @@
1
+ import { RootState } from "..";
2
+ export declare const selectVisible: (state: RootState) => boolean;
@@ -0,0 +1,7 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local selectVisible = function(state)
3
+ return state.app.visible
4
+ end
5
+ return {
6
+ selectVisible = selectVisible,
7
+ }
@@ -0,0 +1,8 @@
1
+ export interface AppState {
2
+ visible: boolean;
3
+ }
4
+ export declare const appSlice: import("@rbxts/reflex").Producer<AppState, {
5
+ setVisible: (state: AppState, visible: boolean) => {
6
+ visible: boolean;
7
+ };
8
+ }>;
@@ -0,0 +1,17 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
4
+ local initialAppState = {
5
+ visible = false,
6
+ }
7
+ local appSlice = createProducer(initialAppState, {
8
+ setVisible = function(state, visible)
9
+ local _object = table.clone(state)
10
+ setmetatable(_object, nil)
11
+ _object.visible = visible
12
+ return _object
13
+ end,
14
+ })
15
+ return {
16
+ appSlice = appSlice,
17
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./app-selectors";
2
+ export * from "./app-slice";
@@ -0,0 +1,10 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ for _k, _v in TS.import(script, script, "app-selectors") or {} do
5
+ exports[_k] = _v
6
+ end
7
+ for _k, _v in TS.import(script, script, "app-slice") or {} do
8
+ exports[_k] = _v
9
+ end
10
+ return exports
@@ -0,0 +1,2 @@
1
+ import { RootState } from "..";
2
+ export declare const selectCommand: (state: RootState) => import("@rbxts/centurion").ImmutableRegistryPath | undefined;
@@ -0,0 +1,7 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local selectCommand = function(state)
3
+ return state.command.path
4
+ end
5
+ return {
6
+ selectCommand = selectCommand,
7
+ }
@@ -0,0 +1,15 @@
1
+ import { ImmutableRegistryPath } from "@rbxts/centurion";
2
+ export interface CommandState {
3
+ path?: ImmutableRegistryPath;
4
+ argIndex?: number;
5
+ }
6
+ export declare const commandSlice: import("@rbxts/reflex").Producer<CommandState, {
7
+ setCommand: (state: CommandState, path?: ImmutableRegistryPath) => {
8
+ path: ImmutableRegistryPath | undefined;
9
+ argIndex?: number;
10
+ };
11
+ setArgIndex: (state: CommandState, index?: number) => {
12
+ argIndex: number | undefined;
13
+ path?: ImmutableRegistryPath;
14
+ };
15
+ }>;
@@ -0,0 +1,21 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
4
+ local initialCommandState = {}
5
+ local commandSlice = createProducer(initialCommandState, {
6
+ setCommand = function(state, path)
7
+ local _object = table.clone(state)
8
+ setmetatable(_object, nil)
9
+ _object.path = path
10
+ return _object
11
+ end,
12
+ setArgIndex = function(state, index)
13
+ local _object = table.clone(state)
14
+ setmetatable(_object, nil)
15
+ _object.argIndex = index
16
+ return _object
17
+ end,
18
+ })
19
+ return {
20
+ commandSlice = commandSlice,
21
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./command-selectors";
2
+ export * from "./command-slice";
@@ -0,0 +1,10 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ for _k, _v in TS.import(script, script, "command-selectors") or {} do
5
+ exports[_k] = _v
6
+ end
7
+ for _k, _v in TS.import(script, script, "command-slice") or {} do
8
+ exports[_k] = _v
9
+ end
10
+ return exports
@@ -0,0 +1,11 @@
1
+ export interface HistoryState {
2
+ commandHistory: string[];
3
+ commandHistoryIndex: number;
4
+ }
5
+ export declare const historySlice: import("@rbxts/reflex").Producer<HistoryState, {
6
+ addCommandHistory: (state: HistoryState, command: string, limit: number) => HistoryState;
7
+ setCommandHistoryIndex: (state: HistoryState, index: number) => {
8
+ commandHistoryIndex: number;
9
+ commandHistory: string[];
10
+ };
11
+ }>;
@@ -0,0 +1,52 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
4
+ local initialHistoryState = {
5
+ commandHistory = {},
6
+ commandHistoryIndex = -1,
7
+ }
8
+ --[[
9
+ *
10
+ * Limits an array by removing the first n (limit) elements if
11
+ * the array's size exceeds the limit.
12
+ *
13
+ * @param array The array to limit
14
+ * @param limit The limit
15
+
16
+ ]]
17
+ local function limitArray(array, limit)
18
+ if #array <= limit then
19
+ return nil
20
+ end
21
+ for i = 0, math.min(#array - 1, limit - 1) do
22
+ table.remove(array, i + 1)
23
+ end
24
+ end
25
+ local historySlice = createProducer(initialHistoryState, {
26
+ addCommandHistory = function(state, command, limit)
27
+ if #state.commandHistory > 0 and state.commandHistory[#state.commandHistory] == command then
28
+ return state
29
+ end
30
+ local _array = {}
31
+ local _length = #_array
32
+ local _array_1 = state.commandHistory
33
+ table.move(_array_1, 1, #_array_1, _length + 1, _array)
34
+ local commandHistory = _array
35
+ limitArray(commandHistory, limit)
36
+ local _command = command
37
+ table.insert(commandHistory, _command)
38
+ local _object = table.clone(state)
39
+ setmetatable(_object, nil)
40
+ _object.commandHistory = commandHistory
41
+ return _object
42
+ end,
43
+ setCommandHistoryIndex = function(state, index)
44
+ local _object = table.clone(state)
45
+ setmetatable(_object, nil)
46
+ _object.commandHistoryIndex = index
47
+ return _object
48
+ end,
49
+ })
50
+ return {
51
+ historySlice = historySlice,
52
+ }
@@ -0,0 +1 @@
1
+ export * from "./history-slice";
@@ -0,0 +1,7 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ for _k, _v in TS.import(script, script, "history-slice") or {} do
5
+ exports[_k] = _v
6
+ end
7
+ return exports
@@ -0,0 +1,46 @@
1
+ import { InferState } from "@rbxts/reflex";
2
+ export type RootStore = typeof store;
3
+ export type RootState = InferState<RootStore>;
4
+ export declare const store: import("@rbxts/reflex").CombineProducers<{
5
+ app: import("@rbxts/reflex").Producer<import("./app").AppState, {
6
+ setVisible: (state: import("./app").AppState, visible: boolean) => {
7
+ visible: boolean;
8
+ };
9
+ }>;
10
+ command: import("@rbxts/reflex").Producer<import("./command").CommandState, {
11
+ setCommand: (state: import("./command").CommandState, path?: import("@rbxts/centurion").ImmutableRegistryPath) => {
12
+ path: import("@rbxts/centurion").ImmutableRegistryPath | undefined;
13
+ argIndex?: number;
14
+ };
15
+ setArgIndex: (state: import("./command").CommandState, index?: number) => {
16
+ argIndex: number | undefined;
17
+ path?: import("@rbxts/centurion").ImmutableRegistryPath;
18
+ };
19
+ }>;
20
+ history: import("@rbxts/reflex").Producer<import("./history").HistoryState, {
21
+ addCommandHistory: (state: import("./history").HistoryState, command: string, limit: number) => import("./history").HistoryState;
22
+ setCommandHistoryIndex: (state: import("./history").HistoryState, index: number) => {
23
+ commandHistoryIndex: number;
24
+ commandHistory: string[];
25
+ };
26
+ }>;
27
+ suggestion: import("@rbxts/reflex").Producer<import("./suggestion").SuggestionState, {
28
+ setSuggestion: (state: import("./suggestion").SuggestionState, suggestion?: import("../types").Suggestion) => {
29
+ current: import("../types").Suggestion | undefined;
30
+ };
31
+ }>;
32
+ text: import("@rbxts/reflex").Producer<import("./text").TextState, {
33
+ setText: (state: import("./text").TextState, text: string, textParts: string[]) => {
34
+ value: string;
35
+ parts: string[];
36
+ index: number;
37
+ valid: boolean;
38
+ };
39
+ setTextValid: (state: import("./text").TextState, valid: boolean) => {
40
+ valid: boolean;
41
+ value: string;
42
+ parts: string[];
43
+ index: number;
44
+ };
45
+ }>;
46
+ }>;
@@ -0,0 +1,18 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local combineProducers = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).combineProducers
4
+ local appSlice = TS.import(script, script, "app").appSlice
5
+ local commandSlice = TS.import(script, script, "command").commandSlice
6
+ local historySlice = TS.import(script, script, "history").historySlice
7
+ local suggestionSlice = TS.import(script, script, "suggestion").suggestionSlice
8
+ local textSlice = TS.import(script, script, "text").textSlice
9
+ local store = combineProducers({
10
+ app = appSlice,
11
+ command = commandSlice,
12
+ history = historySlice,
13
+ suggestion = suggestionSlice,
14
+ text = textSlice,
15
+ })
16
+ return {
17
+ store = store,
18
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./suggestion-selectors";
2
+ export * from "./suggestion-slice";
@@ -0,0 +1,10 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ for _k, _v in TS.import(script, script, "suggestion-selectors") or {} do
5
+ exports[_k] = _v
6
+ end
7
+ for _k, _v in TS.import(script, script, "suggestion-slice") or {} do
8
+ exports[_k] = _v
9
+ end
10
+ return exports
@@ -0,0 +1,2 @@
1
+ import { RootState } from "..";
2
+ export declare const selectSuggestion: (state: RootState) => import("../../types").Suggestion | undefined;
@@ -0,0 +1,7 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local selectSuggestion = function(state)
3
+ return state.suggestion.current
4
+ end
5
+ return {
6
+ selectSuggestion = selectSuggestion,
7
+ }
@@ -0,0 +1,9 @@
1
+ import { Suggestion } from "../../types";
2
+ export interface SuggestionState {
3
+ current?: Suggestion;
4
+ }
5
+ export declare const suggestionSlice: import("@rbxts/reflex").Producer<SuggestionState, {
6
+ setSuggestion: (state: SuggestionState, suggestion?: Suggestion) => {
7
+ current: Suggestion | undefined;
8
+ };
9
+ }>;
@@ -0,0 +1,15 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
4
+ local initialSuggestionState = {}
5
+ local suggestionSlice = createProducer(initialSuggestionState, {
6
+ setSuggestion = function(state, suggestion)
7
+ local _object = table.clone(state)
8
+ setmetatable(_object, nil)
9
+ _object.current = suggestion
10
+ return _object
11
+ end,
12
+ })
13
+ return {
14
+ suggestionSlice = suggestionSlice,
15
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./text-selectors";
2
+ export * from "./text-slice";
@@ -0,0 +1,10 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ for _k, _v in TS.import(script, script, "text-selectors") or {} do
5
+ exports[_k] = _v
6
+ end
7
+ for _k, _v in TS.import(script, script, "text-slice") or {} do
8
+ exports[_k] = _v
9
+ end
10
+ return exports
@@ -0,0 +1,3 @@
1
+ import { RootState } from "..";
2
+ export declare const selectText: (state: RootState) => import("./text-slice").TextState;
3
+ export declare const selectValid: (state: RootState) => boolean;
@@ -0,0 +1,11 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local selectText = function(state)
3
+ return state.text
4
+ end
5
+ local selectValid = function(state)
6
+ return state.text.valid
7
+ end
8
+ return {
9
+ selectText = selectText,
10
+ selectValid = selectValid,
11
+ }
@@ -0,0 +1,20 @@
1
+ export interface TextState {
2
+ value: string;
3
+ parts: string[];
4
+ index: number;
5
+ valid: boolean;
6
+ }
7
+ export declare const textSlice: import("@rbxts/reflex").Producer<TextState, {
8
+ setText: (state: TextState, text: string, textParts: string[]) => {
9
+ value: string;
10
+ parts: string[];
11
+ index: number;
12
+ valid: boolean;
13
+ };
14
+ setTextValid: (state: TextState, valid: boolean) => {
15
+ valid: boolean;
16
+ value: string;
17
+ parts: string[];
18
+ index: number;
19
+ };
20
+ }>;
@@ -0,0 +1,29 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local createProducer = TS.import(script, TS.getModule(script, "@rbxts", "reflex").src).createProducer
4
+ local initialTextState = {
5
+ value = "",
6
+ parts = {},
7
+ index = -1,
8
+ valid = false,
9
+ }
10
+ local textSlice = createProducer(initialTextState, {
11
+ setText = function(state, text, textParts)
12
+ local endsWithSpace = #textParts > 0 and #{ string.match(text, "%s$") } > 0
13
+ local _object = table.clone(state)
14
+ setmetatable(_object, nil)
15
+ _object.value = text
16
+ _object.parts = textParts
17
+ _object.index = if endsWithSpace then #textParts else #textParts - 1
18
+ return _object
19
+ end,
20
+ setTextValid = function(state, valid)
21
+ local _object = table.clone(state)
22
+ setmetatable(_object, nil)
23
+ _object.valid = valid
24
+ return _object
25
+ end,
26
+ })
27
+ return {
28
+ textSlice = textSlice,
29
+ }
package/out/types.d.ts ADDED
@@ -0,0 +1,40 @@
1
+ import { CommandShortcut, HistoryEntry } from "@rbxts/centurion";
2
+ import { InterfacePalette } from "./palette";
3
+ export interface InterfaceOptions {
4
+ anchorPoint?: Vector2;
5
+ size?: UDim2;
6
+ position?: UDim2;
7
+ backgroundTransparency?: number;
8
+ displayOrder?: number;
9
+ hideOnLostFocus: boolean;
10
+ activationKeys: Enum.KeyCode[];
11
+ font: {
12
+ regular: Font;
13
+ medium: Font;
14
+ bold: Font;
15
+ };
16
+ palette: InterfacePalette;
17
+ showShortcutSuggestions?: boolean;
18
+ }
19
+ export interface HistoryLineData {
20
+ entry: HistoryEntry;
21
+ height: number;
22
+ }
23
+ export interface CommandSuggestion {
24
+ type: "command";
25
+ title: string;
26
+ description?: string;
27
+ shortcuts?: CommandShortcut[];
28
+ }
29
+ export interface ArgumentSuggestion {
30
+ type: "argument";
31
+ title: string;
32
+ description?: string;
33
+ dataType: string;
34
+ optional: boolean;
35
+ error?: string;
36
+ }
37
+ export interface Suggestion {
38
+ main: ArgumentSuggestion | CommandSuggestion;
39
+ others: string[];
40
+ }
package/out/types.lua ADDED
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ return nil
@@ -0,0 +1,2 @@
1
+ import { BaseRegistry, RegistryPath } from "@rbxts/centurion";
2
+ export declare function getArgumentNames(registry: BaseRegistry, path: RegistryPath): string[];
@@ -0,0 +1,26 @@
1
+ -- Compiled with roblox-ts v2.3.0-dev-26ec859
2
+ local TS = _G[script]
3
+ local IS_EDIT = TS.import(script, script.Parent.Parent, "constants", "util").IS_EDIT
4
+ local function getArgumentNames(registry, path)
5
+ if IS_EDIT then
6
+ return {}
7
+ end
8
+ local command = registry:getCommand(path)
9
+ if command == nil or command.options.arguments == nil then
10
+ return {}
11
+ end
12
+ local _exp = command.options.arguments
13
+ -- ▼ ReadonlyArray.map ▼
14
+ local _newValue = table.create(#_exp)
15
+ local _callback = function(arg)
16
+ return arg.name
17
+ end
18
+ for _k, _v in _exp do
19
+ _newValue[_k] = _callback(_v, _k - 1, _exp)
20
+ end
21
+ -- ▲ ReadonlyArray.map ▲
22
+ return _newValue
23
+ end
24
+ return {
25
+ getArgumentNames = getArgumentNames,
26
+ }
@@ -0,0 +1,4 @@
1
+ import { BaseRegistry, RegistryPath } from "@rbxts/centurion";
2
+ import { Suggestion } from "../types";
3
+ export declare function getArgumentSuggestion(registry: BaseRegistry, path: RegistryPath, index: number, text?: string): Suggestion | undefined;
4
+ export declare function getCommandSuggestion(registry: BaseRegistry, parentPath?: RegistryPath, text?: string): Suggestion | undefined;