vue3-component-store
Version:
component store solution for vue 3
299 lines (296 loc) • 12.8 kB
text/typescript
import {CombineFeatures, EmptyComponentStore, StoreFeature} from './component-store.model'
import {combineFeatures} from './utilities'
export function storeFeature<F0 extends EmptyComponentStore, F1 extends EmptyComponentStore>(
arg1: StoreFeature<F0, F1>
): CombineFeatures<F0, F1>
export function storeFeature<F0 extends EmptyComponentStore, F1 extends EmptyComponentStore, F2 extends EmptyComponentStore>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>
): CombineFeatures<F0, F1 & F2>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore
>(arg1: StoreFeature<F0, F1>, arg2: StoreFeature<F0 & F1, F2>, arg3: StoreFeature<F0 & F1 & F2, F3>): CombineFeatures<F0, F1 & F2 & F3>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>
): CombineFeatures<F0, F1 & F2 & F3 & F4>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore,
F8 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>,
arg8: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7, F8>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore,
F8 extends EmptyComponentStore,
F9 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>,
arg8: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7, F8>,
arg9: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8, F9>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore,
F8 extends EmptyComponentStore,
F9 extends EmptyComponentStore,
F10 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>,
arg8: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7, F8>,
arg9: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8, F9>,
arg10: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9, F10>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore,
F8 extends EmptyComponentStore,
F9 extends EmptyComponentStore,
F10 extends EmptyComponentStore,
F11 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>,
arg8: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7, F8>,
arg9: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8, F9>,
arg10: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9, F10>,
arg11: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10, F11>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore,
F8 extends EmptyComponentStore,
F9 extends EmptyComponentStore,
F10 extends EmptyComponentStore,
F11 extends EmptyComponentStore,
F12 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>,
arg8: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7, F8>,
arg9: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8, F9>,
arg10: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9, F10>,
arg11: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10, F11>,
arg12: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11, F12>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore,
F8 extends EmptyComponentStore,
F9 extends EmptyComponentStore,
F10 extends EmptyComponentStore,
F11 extends EmptyComponentStore,
F12 extends EmptyComponentStore,
F13 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>,
arg8: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7, F8>,
arg9: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8, F9>,
arg10: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9, F10>,
arg11: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10, F11>,
arg12: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11, F12>,
arg13: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12, F13>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12 & F13>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore,
F8 extends EmptyComponentStore,
F9 extends EmptyComponentStore,
F10 extends EmptyComponentStore,
F11 extends EmptyComponentStore,
F12 extends EmptyComponentStore,
F13 extends EmptyComponentStore,
F14 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>,
arg8: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7, F8>,
arg9: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8, F9>,
arg10: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9, F10>,
arg11: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10, F11>,
arg12: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11, F12>,
arg13: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12, F13>,
arg14: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12 & F13, F14>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12 & F13 & F14>
export function storeFeature<
F0 extends EmptyComponentStore,
F1 extends EmptyComponentStore,
F2 extends EmptyComponentStore,
F3 extends EmptyComponentStore,
F4 extends EmptyComponentStore,
F5 extends EmptyComponentStore,
F6 extends EmptyComponentStore,
F7 extends EmptyComponentStore,
F8 extends EmptyComponentStore,
F9 extends EmptyComponentStore,
F10 extends EmptyComponentStore,
F11 extends EmptyComponentStore,
F12 extends EmptyComponentStore,
F13 extends EmptyComponentStore,
F14 extends EmptyComponentStore,
F15 extends EmptyComponentStore
>(
arg1: StoreFeature<F0, F1>,
arg2: StoreFeature<F0 & F1, F2>,
arg3: StoreFeature<F0 & F1 & F2, F3>,
arg4: StoreFeature<F0 & F1 & F2 & F3, F4>,
arg5: StoreFeature<F0 & F1 & F2 & F3 & F4, F5>,
arg6: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5, F6>,
arg7: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6, F7>,
arg8: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7, F8>,
arg9: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8, F9>,
arg10: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9, F10>,
arg11: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10, F11>,
arg12: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11, F12>,
arg13: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12, F13>,
arg14: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12 & F13, F14>,
arg15: StoreFeature<F0 & F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12 & F13 & F14, F15>
): CombineFeatures<F0, F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8 & F9 & F10 & F11 & F12 & F13 & F14 & F15>
export function storeFeature(...features: StoreFeature[]): CombineFeatures<EmptyComponentStore, EmptyComponentStore> {
return () => {
return combineFeatures(features)
}
}