mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-12 19:12:31 +08:00
Add @type_check_only to stub-only private classes in various third-party stubs (#15535)
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Mapping
|
||||
from logging import Logger
|
||||
from typing import Any, Protocol
|
||||
from typing import Any, Protocol, type_check_only
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# from fonttools.ttLib.ttGlyphSet
|
||||
@type_check_only
|
||||
class _TTGlyph(Protocol):
|
||||
def __init__(self, glyphSet: _TTGlyphSet, glyphName: str) -> None: ...
|
||||
def draw(self, pen) -> None: ...
|
||||
|
||||
@@ -59,7 +59,7 @@ class GraphicsStateDictRegistry(OrderedDict[Raw, Name]):
|
||||
|
||||
def number_to_str(number: Number) -> str: ...
|
||||
def render_pdf_primitive(primitive: _Primitive) -> Raw: ...
|
||||
|
||||
@type_check_only
|
||||
class _DeviceRGBBase(NamedTuple):
|
||||
r: Number
|
||||
g: Number
|
||||
@@ -75,6 +75,7 @@ class DeviceRGB(_DeviceRGBBase):
|
||||
def colors255(self) -> tuple[Number, Number, Number]: ...
|
||||
def serialize(self) -> str: ...
|
||||
|
||||
@type_check_only
|
||||
class _DeviceGrayBase(NamedTuple):
|
||||
g: Number
|
||||
a: Number | None
|
||||
@@ -88,6 +89,7 @@ class DeviceGray(_DeviceGrayBase):
|
||||
def colors255(self) -> tuple[Number, Number, Number]: ...
|
||||
def serialize(self) -> str: ...
|
||||
|
||||
@type_check_only
|
||||
class _DeviceCMYKBase(NamedTuple):
|
||||
c: Number
|
||||
m: Number
|
||||
|
||||
Reference in New Issue
Block a user