declare module "godot.lib.api" { import type * as Godot from "godot"; import type * as GodotJsb from "godot-jsb"; function proxy_unwrap_value(value: T): T; function proxy_wrap_value(value: T): T; function array_proxy(arr: T): T; function object_proxy(obj: T, remap_properties?: boolean): T; function key_only_proxy any)>(target: T): any; function instance_proxy(target_instance: T): T; function class_proxy(target_class: T): T; function function_proxy any>(fn: T): T; function enum_proxy(target_enum: T): T; const proxy: { array_proxy: typeof array_proxy; class_proxy: typeof class_proxy; enum_proxy: typeof enum_proxy; function_proxy: typeof function_proxy; instance_proxy: typeof instance_proxy; key_only_proxy: typeof key_only_proxy; object_proxy: typeof object_proxy; proxy_unwrap_value: typeof proxy_unwrap_value; proxy_wrap_value: typeof proxy_wrap_value; }; type GodotLibApi = typeof Godot & { jsb: typeof GodotJsb; proxy: typeof proxy; }; const api: GodotLibApi; /** * This is a starting point for writing GodotJS code that is camel-case binding agnostic at runtime. * * Library code must consume this API rather than "godot", and be built with camel case bindings disabled. This is to * ensure that the library will function at runtime for all projects irrespective of whether they have camel-case * bindings enabled. */ export = api; } declare module "godot.annotations" { import type * as Godot from "godot"; import type { ClassBinder, RPCConfig } from "godot.annotations"; type VariantConstructor = abstract new (...args: any[]) => NonNullable | Number | String | Boolean; type GObjectConstructor = abstract new (...args: any[]) => Godot.Object; type ClassSpecifier = VariantConstructor | Symbol | EnumPlaceholder | TypePairPlaceholder; interface EnumPlaceholder { target: Record; } interface TypePairPlaceholder { key: VariantConstructor; value: VariantConstructor; } export function EnumType(type: Record): EnumPlaceholder; export function TypePair(key: VariantConstructor, value: VariantConstructor): TypePairPlaceholder; /** @deprecated Use createClassBinder() instead. */ export function signal(): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportSignal: typeof signal; /** @deprecated Use createClassBinder() instead. */ export function export_multiline(): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportMultiline: typeof export_multiline; /** @deprecated Use createClassBinder() instead. */ export function export_range(min: number, max: number, step?: number, ...extra_hints: string[]): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportRange: typeof export_range; /** @deprecated Use createClassBinder() instead. */ export function export_range_i(min: number, max: number, step?: number, ...extra_hints: string[]): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportIntRange: typeof export_range_i; /** String as a path to a file, custom filter provided as hint. */ /** @deprecated Use createClassBinder() instead. */ export function export_file(filter: string): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportFile: typeof export_file; /** @deprecated Use createClassBinder() instead. */ export function export_dir(filter: string): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export function export_global_file(filter: string): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportGlobalFile: typeof export_global_file; /** @deprecated Use createClassBinder() instead. */ export function export_global_dir(filter: string): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportGlobalDir: typeof export_global_dir; /** @deprecated Use createClassBinder() instead. */ export function export_exp_easing(hint?: "" | "attenuation" | "positive_only" | "attenuation,positive_only"): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportExpEasing: typeof export_exp_easing; /** * A Shortcut for `export_(Variant.Type.TYPE_ARRAY, { class_: clazz })` */ /** @deprecated Use createClassBinder() instead. */ export function export_array(clazz: ClassSpecifier): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportArray: typeof export_array; /** * A Shortcut for exporting a dictionary { class_: [key_class, value_class] })` */ /** @deprecated Use createClassBinder() instead. */ export function export_dictionary(key_class: VariantConstructor, value_class: VariantConstructor): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportDictionary: typeof export_dictionary; /** @deprecated Use createClassBinder() instead. */ export function export_object(clazz: GObjectConstructor): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportObject: typeof export_object; /** * [low level export] * @deprecated Use createClassBinder() instead. * */ export function export_(type: Godot.Variant.Type, details?: { class_?: ClassSpecifier; hint?: Godot.PropertyHint; hint_string?: string; usage?: Godot.PropertyUsageFlags; }): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export function Export(type: Godot.Variant.Type, details?: { class?: ClassSpecifier; hint?: Godot.PropertyHint; hintString?: string; usage?: Godot.PropertyUsageFlags; }): (target: any, name: string) => void; /** * In Godot, class members can be exported. * This means their value gets saved along with the resource (such as the scene) they're attached to. * They will also be available for editing in the property editor. * Exporting is done by using the `@export_var` (or `@export_`) annotation. */ /** @deprecated Use createClassBinder() instead. */ export function export_var(type: Godot.Variant.Type, details?: { class_?: ClassSpecifier; hint?: Godot.PropertyHint; hint_string?: string; usage?: Godot.PropertyUsageFlags; }): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportVar: typeof export_var; /** * NOTE only int value enums are allowed */ /** @deprecated Use createClassBinder() instead. */ export function export_enum(enum_type: Record): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportEnum: typeof export_enum; /** * NOTE only int value enums are allowed */ /** @deprecated Use createClassBinder() instead. */ export function export_flags(enum_type: Record): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const ExportFlags: typeof export_flags; /** @deprecated Use createClassBinder() instead. */ export function rpc(config?: RPCConfig): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const Rpc: typeof rpc; /** * auto initialized on ready (before _ready called) * * @deprecated Use createClassBinder() instead. */ export function onready(evaluator: string): (target: any, name: string) => void; /** @deprecated Use createClassBinder() instead. */ export const OnReady: typeof onready; /** @deprecated Use createClassBinder() instead. */ export function tool(): (target: any, name: undefined) => void; /** @deprecated Use createClassBinder() instead. */ export const Tool: typeof tool; /** @deprecated Use createClassBinder() instead. */ export function icon(path: string): (target: any, name: undefined) => void; /** @deprecated Use createClassBinder() instead. */ export const Icon: typeof icon; /** @deprecated Use createClassBinder() instead. */ export function deprecated(message?: string): (target: any, name?: string) => void; /** @deprecated Use createClassBinder() instead. */ export const Deprecated: typeof deprecated; /** @deprecated Use createClassBinder() instead. */ export function experimental(message?: string): (target: any, name?: string) => void; /** @deprecated Use createClassBinder() instead. */ export const Experimental: typeof experimental; /** @deprecated Use createClassBinder() instead. */ export function help(message?: string): (target: any, name?: string) => void; /** @deprecated Use createClassBinder() instead. */ export const Help: typeof help; export type ClassMemberDecorator = (target: ClassMemberDecoratorTarget, context: Context) => void | ClassMemberDecoratorReturn; export type ClassMemberDecoratorTarget = Context extends ClassMethodDecoratorContext ? (...args: unknown[]) => Value : Context extends ClassGetterDecoratorContext ? () => Value : Context extends ClassSetterDecoratorContext ? (value: Value) => void : Context extends ClassFieldDecoratorContext ? undefined : Context extends ClassAccessorDecoratorContext ? { get: () => Value; set: (value: Value) => void; } : never; export type ClassMemberDecoratorReturn = Context extends ClassMethodDecoratorContext ? (this: This, ...args: unknown[]) => Value : Context extends ClassGetterDecoratorContext ? (this: This) => Value : Context extends ClassSetterDecoratorContext ? (this: This, value: Value) => void : Context extends ClassFieldDecoratorContext ? (this: This, initialValue: Value) => Value : Context extends ClassAccessorDecoratorContext ? { get?(this: This): Value; set?(this: This, value: Value): void; init?(this: This, initialValue: Value): Value; } : never; export type ClassDecorator any = abstract new (...args: any) => any> = (target: This, context: ClassDecoratorContext) => void; export type ClassDecoratorClass = Context extends ClassDecoratorContext ? Class : never; export type Decorator = RestrictedContext extends ClassDecoratorContext ? (target: ClassDecoratorClass, context: Context) => void : RestrictedContext extends ClassMemberDecoratorContext ? (target: ClassMemberDecoratorTarget, context: Context) => void | ClassMemberDecoratorReturn : never; export type AnyDecorator = (value: unknown, context: DecoratorContext) => unknown; export type ClassValueMemberDecoratorContext = ClassGetterDecoratorContext | ClassSetterDecoratorContext | ClassFieldDecoratorContext | ClassAccessorDecoratorContext; export function createClassBinder(): ClassBinder; } declare module "godot.typeloader" { /** * @param type the loaded type or function in godot module */ export type TypeLoadedCallback = (type: any) => void; export function on_type_loaded(type_name: string | string[], callback: TypeLoadedCallback): void; } declare module "jsb.core" { } declare module "jsb.inject" { }