# Released under the MIT License. See LICENSE for details.#"""Public types for assets-v1 workspaces.These types may only be used server-side, but they are exposed herefor reference when setting workspace config data by hand or for usein client-side workspace modification tools. There may be advancedsettings that are not accessible through the UI/etc."""from__future__importannotationsimportdatetimefromenumimportEnumfromdataclassesimportdataclass,fieldfromtypingimportTYPE_CHECKING,Annotated,override,assert_neverfromefro.dataclassioimportioprepped,IOAttrs,IOMultiTypefrombacommon.localeimportLocaleifTYPE_CHECKING:pass
[docs]@ioprepped@dataclassclassAssetsV1GlobalVals:"""Global values for an assets_v1 workspace."""base_assets:str|None=Nonebase_assets_filter:str=''
[docs]classAssetsV1StringFileTypeID(Enum):"""Type ID for each of our subclasses."""V1='v1'
[docs]classAssetsV1StringFile(IOMultiType[AssetsV1StringFileTypeID]):"""Top level class for our multitype."""
[docs]@override@classmethoddefget_type_id(cls)->AssetsV1StringFileTypeID:# Require child classes to supply this themselves. If we did a# full type registry/lookup here it would require us to import# everything and would prevent lazy loading.raiseNotImplementedError()
[docs]@override@classmethoddefget_type(cls,type_id:AssetsV1StringFileTypeID)->type[AssetsV1StringFile]:"""Return the subclass for each of our type-ids."""# pylint: disable=cyclic-importt=AssetsV1StringFileTypeIDiftype_idist.V1:returnAssetsV1StringFileV1# Important to make sure we provide all types.assert_never(type_id)
[docs]@ioprepped@dataclassclassAssetsV1StringFileV1(AssetsV1StringFile):"""Our initial version of string file data."""
[docs]classStylePreset(Enum):"""Preset for general styling in translated strings."""NONE='none'TITLE='title'INTENSE='intense'SUBTLE='subtle'
[docs]@dataclassclassOutput:"""Represents a single localized output."""#: When this output was last changed.modtime:datetime.datetime#: Default value (no counts involved).value:str
[docs]@override@classmethoddefget_type_id(cls)->AssetsV1PathValsTypeID:# Require child classes to supply this themselves. If we# did a full type registry/lookup here it would require us# to import everything and would prevent lazy loading.raiseNotImplementedError()
[docs]@override@classmethoddefget_type(cls,type_id:AssetsV1PathValsTypeID)->type[AssetsV1PathVals]:# pylint: disable=cyclic-importt=AssetsV1PathValsTypeIDiftype_idist.TEX_V1:returnAssetsV1PathValsTexV1# Important to make sure we provide all types.assert_never(type_id)
[docs]@ioprepped@dataclassclassAssetsV1PathValsTexV1(AssetsV1PathVals):"""Path-specific values for an assets_v1 workspace path."""
[docs]classTextureQuality(Enum):"""Quality settings for our textures."""LOW='low'MEDIUM='medium'HIGH='high'
# Just dummy testing values for now.texture_quality:TextureQuality=TextureQuality.MEDIUM
# Docs-generation hack; import some stuff that we likely only forward-declared# in our actual source code so that docs tools can find it.fromtypingimport(Coroutine,Any,Literal,Callable,Generator,Awaitable,Sequence,Self)importasynciofromconcurrent.futuresimportFuturefrompathlibimportPathfromenumimportEnum