2
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
7
* http://www.apache.org/licenses/LICENSE-2.0
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
16
import { KoalaCallsiteKey } from "@koalaui/common"
17
import { StateContext } from "./states/State"
19
// These are used for the hidden parameters inserted by the plugin.
20
// Must only be used by compiler rewrite, do not use directly.
21
export type __memo_context_type = StateContext
22
export type __memo_id_type = KoalaCallsiteKey
23
// References to this type will be changed to an incompatible type
24
// so that typing expression `x extends __memo_transformed ? A : B`
25
// can change its branch
26
export type __memo_transformed_before = string
27
export type __memo_transformed_after = number
28
export type __memo_transformed = __memo_transformed_before
30
export function __context(): StateContext {
31
throw new Error("All __context() references should have been transformed by the compiler plugin. Either have 'context' argument or have '/** @memo */' marking and use intrinsic '__context()'.")
34
export function __id(): KoalaCallsiteKey {
35
throw new Error("All __id() references should have been transformed by the compiler plugin. Either have 'id' argument or have '/** @memo */' marking and use intrinsic '__id()'.")
38
export function __key(): KoalaCallsiteKey {
39
throw new Error("All __key() references should have been transformed by the compiler plugin.")