@rbxts/app-forge 0.6.0-alpha.41 → 0.6.0-alpha.42

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.
@@ -1,8 +1,8 @@
1
1
  import Vide from "@rbxts/vide";
2
2
  import type Types from "./types";
3
3
  import type AppForge from ".";
4
- export declare const AppRegistry: Map<string, Types.AppRegistry>;
5
- export declare function App(props: Types.AppRegistryProps): <T extends new (props: Types.MainProps) => Args>(constructor: T) => T;
4
+ export declare const AppRegistry: Map<string, Types.AppRegistry<string>>;
5
+ export declare function App<N extends AppNames>(props: Types.AppRegistryProps<N>): <T extends new (props: Types.MainProps) => Args>(constructor: T) => T;
6
6
  export declare abstract class Args {
7
7
  readonly forge: AppForge;
8
8
  readonly props: Types.ClassProps;
@@ -16,6 +16,9 @@ local function ParentRule(entry, forge)
16
16
  _condition = rules.parent == entry
17
17
  end
18
18
  if _condition ~= "" and _condition then
19
+ if entry == name then
20
+ return warn(`{entry} tried to close {name} either they have the same ID name or they ARE the same`)
21
+ end
19
22
  local _sources = forge.sources
20
23
  local _entry = entry
21
24
  if not _sources[_entry]() then
@@ -3,10 +3,10 @@ import type { Args } from "./decorator";
3
3
  import type AppForge from ".";
4
4
 
5
5
  declare namespace Types {
6
- type AppRegistryProps = {
7
- name: AppNames;
6
+ type AppRegistryProps<N extends AppNames> = {
7
+ name: N;
8
8
  visible?: boolean;
9
- rules?: Rules.All;
9
+ rules?: Rules.All<N>;
10
10
  };
11
11
 
12
12
  type NameProps =
@@ -30,15 +30,15 @@ declare namespace Types {
30
30
  px: typeof import("@rbxts/loners-pretty-vide-utils").px;
31
31
  };
32
32
 
33
- type AppRegistry = {
33
+ type AppRegistry<N extends AppNames = AppNames> = {
34
34
  constructor: new (props: MainProps) => Args;
35
35
  visible?: boolean;
36
- rules?: Rules.All;
36
+ rules?: Rules.All<N>;
37
37
  };
38
38
 
39
39
  namespace Rules {
40
- type All = {
41
- parent?: AppNames | string;
40
+ type All<N extends AppNames> = {
41
+ parent?: Exclude<AppNames, N> | string;
42
42
  exclusiveGroup?: GroupNames | string;
43
43
  };
44
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/app-forge",
3
- "version": "0.6.0-alpha.41",
3
+ "version": "0.6.0-alpha.42",
4
4
  "description": "An App Manager for react",
5
5
  "main": "out/init.lua",
6
6
  "types": "out/index.d.ts",