@carbonorm/carbonreact 2.0.0 → 2.0.1

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,18 +1,20 @@
1
- import CarbonReact, {iCarbonORMState, iRestfulObjectArrayTypes, tRestfulObjectValues} from "CarbonReact";
1
+ import CarbonReact, {iCarbonORMState} from "CarbonReact";
2
+ import {iRestfulObjectArrayTypes, tRestfulObjectValues} from "variables/C6";
2
3
 
3
4
 
4
5
  //ObjectType, UniqueIdType extends keyof ObjectType
5
- export default function deleteRestfulObjectArrays<ObjectType extends tRestfulObjectValues>
6
+ export default function deleteRestfulObjectArrays<ObjectType = tRestfulObjectValues, ObjectArrayTypes = iRestfulObjectArrayTypes>
6
7
  (dataOrCallback: ((prev: Readonly<iCarbonORMState>) => ObjectType[]) | ObjectType[],
7
- stateKey: keyof iRestfulObjectArrayTypes,
8
+ stateKey: keyof ObjectArrayTypes,
8
9
  uniqueObjectId: keyof ObjectType,
9
10
  callback?: () => void): void {
10
11
 
11
- return CarbonReact.instance.setState((previousBootstrapState): {} => {
12
+ return CarbonReact.instance.setState((previousBootstrapState ): {} => {
12
13
 
13
14
  let newOrReplacementData: ObjectType[] = dataOrCallback instanceof Function ? dataOrCallback(previousBootstrapState) : dataOrCallback;
14
15
 
15
- const previousStateProperty = previousBootstrapState[stateKey] as ObjectType[];
16
+ // @ts-ignore
17
+ const previousStateProperty = previousBootstrapState[stateKey];
16
18
 
17
19
  return {
18
20
  [stateKey]: null === previousBootstrapState ? null : [
@@ -1,8 +1,7 @@
1
1
  import CarbonReact, {
2
- iCarbonORMState,
3
- iRestfulObjectArrayTypes,
4
- tRestfulObjectValues
2
+ iCarbonORMState
5
3
  } from "CarbonReact";
4
+ import {iRestfulObjectArrayTypes, tRestfulObjectValues} from "variables/C6";
6
5
 
7
6
 
8
7
  export enum eUpdateInsertMethod {
@@ -21,9 +20,9 @@ export enum eUpdateInsertMethod {
21
20
  * @param callback - if you want to do something with the updated state, you can pass a callback here. Run as the second
22
21
  * parameter of setState.
23
22
  */
24
- export default function updateRestfulObjectArray<ObjectType extends tRestfulObjectValues>
23
+ export default function updateRestfulObjectArray<ObjectType = tRestfulObjectValues, ObjectArrayTypes = iRestfulObjectArrayTypes>
25
24
  (dataOrCallback: ((prev: Readonly<iCarbonORMState>) => ObjectType[]) | ObjectType[],
26
- stateKey: keyof iRestfulObjectArrayTypes,
25
+ stateKey: keyof ObjectArrayTypes,
27
26
  uniqueObjectId: keyof ObjectType,
28
27
  insertUpdateOrder: eUpdateInsertMethod = eUpdateInsertMethod.LAST,
29
28
  callback?: () => void): void {
@@ -34,7 +33,8 @@ export default function updateRestfulObjectArray<ObjectType extends tRestfulObje
34
33
 
35
34
  let newOrReplacementData: ObjectType[] = dataOrCallback instanceof Function ? dataOrCallback(previousBootstrapState) : dataOrCallback;
36
35
 
37
- const previousStateProperty = previousBootstrapState[stateKey] as ObjectType[];
36
+ // @ts-ignore
37
+ const previousStateProperty = previousBootstrapState[stateKey];
38
38
 
39
39
  let updatedData = newOrReplacementData.map(value => {
40
40
  return {
package/src/index.ts CHANGED
@@ -12,8 +12,6 @@ export { default as BackendThrowable } from "./components/Errors/BackendThrowabl
12
12
  export * from "./components/Errors/BackendThrowable";
13
13
  export { default as ErrorHttpCode } from "./components/Errors/ErrorHttpCode";
14
14
  export * from "./components/Errors/ErrorHttpCode";
15
- export { default as Localhost } from "./components/Errors/Localhost";
16
- export * from "./components/Errors/Localhost";
17
15
  export { default as PageNotFound } from "./components/Errors/PageNotFound";
18
16
  export * from "./components/Errors/PageNotFound";
19
17
  export { default as Loading } from "./components/Loading/Loading";
@@ -1802,7 +1802,7 @@ export interface iRestfulObjectArrayTypes {
1802
1802
  users: tStatefulApiData<iUsers>,
1803
1803
  }
1804
1804
 
1805
- export const initialRestfulObjectArrayTypes: iRestfulObjectArrayTypes = {
1805
+ export const initialRestfulObjectsState: iRestfulObjectArrayTypes = {
1806
1806
 
1807
1807
  carbons: undefined,
1808
1808
  comments: undefined,
@@ -1832,3 +1832,5 @@ export type tRestfulObjectArrayValues = iRestfulObjectArrayTypes[tRestfulObjectA
1832
1832
  export type tRestfulObjectValues = tRestfulObjectArrayValues[number];
1833
1833
 
1834
1834
 
1835
+
1836
+
@@ -1 +0,0 @@
1
- export default function Localhost(): import("react/jsx-runtime").JSX.Element;