typing

class janim.typing.SupportsApartAlpha(*args, **kwargs)

基类:Protocol

apart_alpha(n: int) None
class janim.typing.SupportsAnim(*args, **kwargs)

基类:Protocol

可传入 AnimGroup 的对象,需要具有 __anim__ 方法

因为可传入 AnimGroup 的对象分为两种:

  • 本身就是 Animation 对象

  • 具有 __anim__ 方法,这个方法在调用后返回一个 Animation 对象

由于 Animation 对象本身就实现了 __anim__ 方法返回自己, 所以用 SupportsAnim 作为它们的统称,并会被 AnimGroup._get_animation_objects 统一转化

class janim.typing.SupportsTracking(*args, **kwargs)

基类:Protocol

定义了可直接被 Cmpt_Data 所跟踪的对象类型

对于没有实现这些方法的对象,使用 register_funcs() 另行定义类型的这三个方法

copy() Self
not_changed(other: Self) bool
interpolate(other: Self, alpha: float) Self
janim.typing.t_(*x: str) Any

提供给 janim-toolbox VS Code 插件,用于标注其中包含的字符串需要 Typst 高亮