mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
backport nerd font attribute generator to Python 3.11
This commit is contained in:
@ -14,11 +14,10 @@ import sys
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from typing import Literal, TypedDict, cast
|
from typing import Literal, TypedDict, cast, TypeAlias
|
||||||
|
|
||||||
type PatchSetAttributes = dict[Literal["default"] | int, PatchSetAttributeEntry]
|
|
||||||
type AttributeHash = tuple[str | None, str | None, str, float, float, float]
|
AttributeHash: TypeAlias = tuple[str | None, str | None, str, float, float, float]
|
||||||
type ResolvedSymbol = PatchSetAttributes | PatchSetScaleRules | int | None
|
|
||||||
|
|
||||||
|
|
||||||
class PatchSetScaleRules(TypedDict):
|
class PatchSetScaleRules(TypedDict):
|
||||||
@ -33,6 +32,9 @@ class PatchSetAttributeEntry(TypedDict):
|
|||||||
params: dict[str, float | bool]
|
params: dict[str, float | bool]
|
||||||
|
|
||||||
|
|
||||||
|
PatchSetAttributes: TypeAlias = dict[Literal["default"] | int, PatchSetAttributeEntry]
|
||||||
|
ResolvedSymbol: TypeAlias = PatchSetAttributes | PatchSetScaleRules | int | None
|
||||||
|
|
||||||
class PatchSet(TypedDict):
|
class PatchSet(TypedDict):
|
||||||
SymStart: int
|
SymStart: int
|
||||||
SymEnd: int
|
SymEnd: int
|
||||||
|
Reference in New Issue
Block a user