mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-13 03:21:07 +08:00
Replace Incomplete | None = None in third party stubs (#14063)
This commit is contained in:
@@ -48,7 +48,7 @@ class AnnotationMixin:
|
||||
ink_list: tuple[int, ...] = (),
|
||||
file_spec: str | None = None,
|
||||
field_type: str | None = None,
|
||||
value: Incomplete | None = None,
|
||||
value=None,
|
||||
default_appearance: str | None = None,
|
||||
) -> None: ...
|
||||
|
||||
|
||||
@@ -72,8 +72,8 @@ class DeviceCMYK(_DeviceCMYKBase):
|
||||
def colors(self) -> tuple[Number, Number, Number, Number]: ...
|
||||
def serialize(self) -> str: ...
|
||||
|
||||
def rgb8(r, g, b, a: Incomplete | None = None) -> DeviceRGB: ...
|
||||
def gray8(g, a: Incomplete | None = None) -> DeviceGray: ...
|
||||
def rgb8(r, g, b, a=None) -> DeviceRGB: ...
|
||||
def gray8(g, a=None) -> DeviceGray: ...
|
||||
@overload
|
||||
def convert_to_device_color(r: DeviceCMYK) -> DeviceCMYK: ...
|
||||
@overload
|
||||
@@ -86,7 +86,7 @@ def convert_to_device_color(r: str) -> DeviceRGB: ...
|
||||
def convert_to_device_color(r: int, g: Literal[-1] = -1, b: Literal[-1] = -1) -> DeviceGray: ...
|
||||
@overload
|
||||
def convert_to_device_color(r: Sequence[int] | int, g: int, b: int) -> DeviceGray | DeviceRGB: ...
|
||||
def cmyk8(c, m, y, k, a: Incomplete | None = None) -> DeviceCMYK: ...
|
||||
def cmyk8(c, m, y, k, a=None) -> DeviceCMYK: ...
|
||||
def color_from_hex_string(hexstr) -> DeviceRGB: ...
|
||||
def color_from_rgb_string(rgbstr) -> DeviceRGB: ...
|
||||
|
||||
@@ -118,18 +118,18 @@ class Transform(NamedTuple):
|
||||
@classmethod
|
||||
def translation(cls, x, y): ...
|
||||
@classmethod
|
||||
def scaling(cls, x, y: Incomplete | None = None): ...
|
||||
def scaling(cls, x, y=None): ...
|
||||
@classmethod
|
||||
def rotation(cls, theta): ...
|
||||
@classmethod
|
||||
def rotation_d(cls, theta_d): ...
|
||||
@classmethod
|
||||
def shearing(cls, x, y: Incomplete | None = None): ...
|
||||
def shearing(cls, x, y=None): ...
|
||||
def translate(self, x, y): ...
|
||||
def scale(self, x, y: Incomplete | None = None): ...
|
||||
def scale(self, x, y=None): ...
|
||||
def rotate(self, theta): ...
|
||||
def rotate_d(self, theta_d): ...
|
||||
def shear(self, x, y: Incomplete | None = None): ...
|
||||
def shear(self, x, y=None): ...
|
||||
def about(self, x, y): ...
|
||||
def __mul__(self, other): ...
|
||||
def __rmul__(self, other): ...
|
||||
@@ -379,17 +379,13 @@ class PaintedPath:
|
||||
def arc_to(self, rx, ry, rotation, large_arc, positive_sweep, x, y) -> Self: ...
|
||||
def arc_relative(self, rx, ry, rotation, large_arc, positive_sweep, dx, dy) -> Self: ...
|
||||
def close(self) -> None: ...
|
||||
def render(
|
||||
self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = None, pfx: Incomplete | None = None
|
||||
): ...
|
||||
def render(self, gsd_registry, style, last_item, initial_point, debug_stream=None, pfx=None): ...
|
||||
def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ...
|
||||
|
||||
class ClippingPath(PaintedPath):
|
||||
paint_rule: Incomplete
|
||||
def __init__(self, x: int = 0, y: int = 0) -> None: ...
|
||||
def render(
|
||||
self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = None, pfx: Incomplete | None = None
|
||||
): ...
|
||||
def render(self, gsd_registry, style, last_item, initial_point, debug_stream=None, pfx=None): ...
|
||||
def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ...
|
||||
|
||||
class GraphicsContext:
|
||||
@@ -409,24 +405,10 @@ class GraphicsContext:
|
||||
def remove_last_item(self) -> None: ...
|
||||
def merge(self, other_context) -> None: ...
|
||||
def build_render_list(
|
||||
self,
|
||||
gsd_registry,
|
||||
style,
|
||||
last_item,
|
||||
initial_point,
|
||||
debug_stream: Incomplete | None = None,
|
||||
pfx: Incomplete | None = None,
|
||||
_push_stack: bool = True,
|
||||
self, gsd_registry, style, last_item, initial_point, debug_stream=None, pfx=None, _push_stack: bool = True
|
||||
): ...
|
||||
def render(
|
||||
self,
|
||||
gsd_registry,
|
||||
style: DrawingContext,
|
||||
last_item,
|
||||
initial_point,
|
||||
debug_stream: Incomplete | None = None,
|
||||
pfx: Incomplete | None = None,
|
||||
_push_stack: bool = True,
|
||||
self, gsd_registry, style: DrawingContext, last_item, initial_point, debug_stream=None, pfx=None, _push_stack: bool = True
|
||||
): ...
|
||||
def render_debug(
|
||||
self, gsd_registry, style: DrawingContext, last_item, initial_point, debug_stream, pfx, _push_stack: bool = True
|
||||
|
||||
@@ -29,7 +29,7 @@ class FontFace:
|
||||
def __init__(
|
||||
self,
|
||||
family: str | None = None,
|
||||
emphasis: Incomplete | None = None,
|
||||
emphasis=None,
|
||||
size_pt: int | None = None,
|
||||
color: int | tuple[Number, Number, Number] | DeviceGray | DeviceRGB | None = None,
|
||||
fill_color: int | tuple[Number, Number, Number] | DeviceGray | DeviceRGB | None = None,
|
||||
@@ -149,13 +149,7 @@ class SubsetMap:
|
||||
def items(self) -> Generator[Incomplete, None, None]: ...
|
||||
def pick(self, unicode: int): ...
|
||||
def pick_glyph(self, glyph): ...
|
||||
def get_glyph(
|
||||
self,
|
||||
glyph: Incomplete | None = None,
|
||||
unicode: Incomplete | None = None,
|
||||
glyph_name: Incomplete | None = None,
|
||||
glyph_width: Incomplete | None = None,
|
||||
) -> Glyph: ...
|
||||
def get_glyph(self, glyph=None, unicode=None, glyph_name=None, glyph_width=None) -> Glyph: ...
|
||||
def get_all_glyph_names(self): ...
|
||||
|
||||
CORE_FONTS: dict[str, str]
|
||||
|
||||
+11
-11
@@ -298,11 +298,11 @@ class FPDF(GraphicsStateMixin):
|
||||
def get_string_width(self, s: str, normalized: bool = False, markdown: bool = False) -> float: ...
|
||||
def set_line_width(self, width: float) -> None: ...
|
||||
def set_page_background(self, background) -> None: ...
|
||||
def drawing_context(self, debug_stream: Incomplete | None = None) -> _GeneratorContextManager[DrawingContext]: ...
|
||||
def drawing_context(self, debug_stream=None) -> _GeneratorContextManager[DrawingContext]: ...
|
||||
def new_path(
|
||||
self, x: float = 0, y: float = 0, paint_rule: PathPaintRule = ..., debug_stream: Incomplete | None = None
|
||||
self, x: float = 0, y: float = 0, paint_rule: PathPaintRule = ..., debug_stream=None
|
||||
) -> _GeneratorContextManager[PaintedPath]: ...
|
||||
def draw_path(self, path: PaintedPath, debug_stream: Incomplete | None = None) -> None: ...
|
||||
def draw_path(self, path: PaintedPath, debug_stream=None) -> None: ...
|
||||
def set_dash_pattern(self, dash: float = 0, gap: float = 0, phase: float = 0) -> None: ...
|
||||
def line(self, x1: float, y1: float, x2: float, y2: float) -> None: ...
|
||||
def polyline(
|
||||
@@ -505,14 +505,14 @@ class FPDF(GraphicsStateMixin):
|
||||
def local_context(
|
||||
self,
|
||||
*,
|
||||
font_family: Incomplete | None = None,
|
||||
font_style: Incomplete | None = None,
|
||||
font_size_pt: Incomplete | None = None,
|
||||
line_width: Incomplete | None = None,
|
||||
draw_color: Incomplete | None = None,
|
||||
fill_color: Incomplete | None = None,
|
||||
text_color: Incomplete | None = None,
|
||||
dash_pattern: Incomplete | None = None,
|
||||
font_family=None,
|
||||
font_style=None,
|
||||
font_size_pt=None,
|
||||
line_width=None,
|
||||
draw_color=None,
|
||||
fill_color=None,
|
||||
text_color=None,
|
||||
dash_pattern=None,
|
||||
font_size=..., # semi-deprecated, prefer font_size_pt
|
||||
char_vpos=...,
|
||||
char_spacing=...,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterable
|
||||
from dataclasses import dataclass
|
||||
from io import BytesIO
|
||||
@@ -40,7 +39,7 @@ def get_svg_info(filename: str, img: BytesIO, image_cache: ImageCache) -> tuple[
|
||||
|
||||
# Returned dict could be typed as a TypedDict.
|
||||
def get_img_info(
|
||||
filename, img: BytesIO | Image.Image | None = None, image_filter: _ImageFilter = "AUTO", dims: Incomplete | None = None
|
||||
filename, img: BytesIO | Image.Image | None = None, image_filter: _ImageFilter = "AUTO", dims=None
|
||||
) -> dict[str, Any]: ...
|
||||
|
||||
class temp_attr:
|
||||
|
||||
@@ -34,14 +34,7 @@ class PDFFont(PDFObject):
|
||||
c_i_d_system_info: Incomplete | None
|
||||
font_descriptor: Incomplete | None
|
||||
c_i_d_to_g_i_d_map: Incomplete | None
|
||||
def __init__(
|
||||
self,
|
||||
subtype: str,
|
||||
base_font: str,
|
||||
encoding: str | None = None,
|
||||
d_w: Incomplete | None = None,
|
||||
w: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def __init__(self, subtype: str, base_font: str, encoding: str | None = None, d_w=None, w=None) -> None: ...
|
||||
|
||||
class CIDSystemInfo(PDFObject):
|
||||
registry: PDFString
|
||||
@@ -88,13 +81,7 @@ class PDFCatalog(PDFObject):
|
||||
outlines: Incomplete | None
|
||||
output_intents: Incomplete | None
|
||||
struct_tree_root: Incomplete | None
|
||||
def __init__(
|
||||
self,
|
||||
lang: str | None = None,
|
||||
page_layout: Incomplete | None = None,
|
||||
page_mode: Incomplete | None = None,
|
||||
viewer_preferences: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def __init__(self, lang: str | None = None, page_layout=None, page_mode=None, viewer_preferences=None) -> None: ...
|
||||
|
||||
class PDFResources(PDFObject):
|
||||
proc_set: Incomplete
|
||||
@@ -134,8 +121,8 @@ class PDFXObject(PDFContentStream):
|
||||
color_space,
|
||||
bits_per_component,
|
||||
img_filter: str | None = None,
|
||||
decode: Incomplete | None = None,
|
||||
decode_parms: Incomplete | None = None,
|
||||
decode=None,
|
||||
decode_parms=None,
|
||||
) -> None: ...
|
||||
|
||||
class PDFICCProfile(PDFContentStream):
|
||||
@@ -214,7 +201,7 @@ class OutputIntentDictionary:
|
||||
dest_output_profile: PDFICCProfile | None = None,
|
||||
info: str | None = None,
|
||||
) -> None: ...
|
||||
def serialize(self, _security_handler: StandardSecurityHandler | None = None, _obj_id: Incomplete | None = None): ...
|
||||
def serialize(self, _security_handler: StandardSecurityHandler | None = None, _obj_id=None): ...
|
||||
|
||||
class ResourceCatalog:
|
||||
resources: defaultdict[PDFResourceType, dict[Incomplete, Incomplete]]
|
||||
|
||||
@@ -78,7 +78,7 @@ class LinearGradient(Gradient):
|
||||
to_x: float,
|
||||
to_y: float,
|
||||
colors: list[Incomplete],
|
||||
background: Incomplete | None = None,
|
||||
background=None,
|
||||
extend_before: bool = False,
|
||||
extend_after: bool = False,
|
||||
bounds: list[int] | None = None,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Literal
|
||||
|
||||
from .enums import Duplex, PageBoundaries, PageMode, TextDirection
|
||||
@@ -26,7 +25,7 @@ class ViewerPreferences:
|
||||
view_clip: PageBoundaries | None = None,
|
||||
print_area: PageBoundaries | None = None,
|
||||
print_clip: PageBoundaries | None = None,
|
||||
print_scaling: Incomplete | None = None,
|
||||
print_scaling=None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def non_full_screen_page_mode(self) -> PageMode | None: ...
|
||||
|
||||
@@ -10,13 +10,7 @@ class Signature:
|
||||
reason: Incomplete | None
|
||||
byte_range: str
|
||||
contents: str
|
||||
def __init__(
|
||||
self,
|
||||
contact_info: Incomplete | None = None,
|
||||
location: Incomplete | None = None,
|
||||
m: Incomplete | None = None,
|
||||
reason: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def __init__(self, contact_info=None, location=None, m=None, reason=None) -> None: ...
|
||||
def serialize(self) -> str: ...
|
||||
|
||||
def sign_content(signer, buffer, key, cert, extra_certs, hashalgo, sign_time): ...
|
||||
|
||||
@@ -110,12 +110,10 @@ class SVGObject:
|
||||
def transform_to_rect_viewport(
|
||||
self, scale, width, height, align_viewbox: bool = True, ignore_svg_top_attrs: bool = False
|
||||
): ...
|
||||
def draw_to_page(
|
||||
self, pdf: FPDF, x: Incomplete | None = None, y: Incomplete | None = None, debug_stream: Incomplete | None = None
|
||||
) -> None: ...
|
||||
def draw_to_page(self, pdf: FPDF, x=None, y=None, debug_stream=None) -> None: ...
|
||||
def handle_defs(self, defs) -> None: ...
|
||||
def build_xref(self, xref): ...
|
||||
def build_group(self, group, pdf_group: Incomplete | None = None): ...
|
||||
def build_group(self, group, pdf_group=None): ...
|
||||
def build_path(self, path): ...
|
||||
def build_shape(self, shape): ...
|
||||
def build_clipping_path(self, shape, clip_id): ...
|
||||
|
||||
@@ -20,9 +20,7 @@ def create_dictionary_string(
|
||||
) -> str: ...
|
||||
def create_list_string(list_): ...
|
||||
def iobj_ref(n): ...
|
||||
def create_stream(
|
||||
stream: str | bytes | bytearray, encryption_handler: StandardSecurityHandler | None = None, obj_id: Incomplete | None = None
|
||||
): ...
|
||||
def create_stream(stream: str | bytes | bytearray, encryption_handler: StandardSecurityHandler | None = None, obj_id=None): ...
|
||||
|
||||
class Raw(str): ...
|
||||
|
||||
@@ -37,7 +35,7 @@ class PDFObject:
|
||||
def id(self, n: int) -> None: ...
|
||||
@property
|
||||
def ref(self) -> str: ...
|
||||
def serialize(self, obj_dict: Incomplete | None = None, _security_handler: StandardSecurityHandler | None = None) -> str: ...
|
||||
def serialize(self, obj_dict=None, _security_handler: StandardSecurityHandler | None = None) -> str: ...
|
||||
def content_stream(self) -> bytes: ...
|
||||
|
||||
class PDFContentStream(PDFObject):
|
||||
@@ -78,9 +76,5 @@ class DestinationXYZ(Destination):
|
||||
def __init__(self, page: int, top: float, left: float = 0, zoom: float | Literal["null"] = "null") -> None: ...
|
||||
def serialize(self) -> str: ...
|
||||
def replace(
|
||||
self,
|
||||
page: Incomplete | None = None,
|
||||
top: float | None = None,
|
||||
left: float | None = None,
|
||||
zoom: float | Literal["null"] | None = None,
|
||||
self, page=None, top: float | None = None, left: float | None = None, zoom: float | Literal["null"] | None = None
|
||||
) -> DestinationXYZ: ...
|
||||
|
||||
@@ -52,14 +52,10 @@ class Table:
|
||||
outer_border_width: float | None = None,
|
||||
num_heading_rows: int = 1,
|
||||
repeat_headings: TableHeadingsDisplay | int = 1,
|
||||
min_row_height: Incomplete | None = None,
|
||||
min_row_height=None,
|
||||
) -> None: ...
|
||||
def row(
|
||||
self,
|
||||
cells: Iterable[str] = (),
|
||||
style: FontFace | None = None,
|
||||
v_align: VAlign | str | None = None,
|
||||
min_height: Incomplete | None = None,
|
||||
self, cells: Iterable[str] = (), style: FontFace | None = None, v_align: VAlign | str | None = None, min_height=None
|
||||
) -> Row: ...
|
||||
def render(self) -> None: ...
|
||||
def get_cell_border(self, i: int, j: int, cell: Cell) -> str | Literal[0, 1]: ...
|
||||
@@ -70,11 +66,7 @@ class Row:
|
||||
v_align: VAlign | None
|
||||
min_height: Incomplete | None
|
||||
def __init__(
|
||||
self,
|
||||
table: Table,
|
||||
style: FontFace | None = None,
|
||||
v_align: VAlign | str | None = None,
|
||||
min_height: Incomplete | None = None,
|
||||
self, table: Table, style: FontFace | None = None, v_align: VAlign | str | None = None, min_height=None
|
||||
) -> None: ...
|
||||
@property
|
||||
def cols_count(self) -> int: ...
|
||||
@@ -126,7 +118,7 @@ class Cell:
|
||||
link: str | int | None
|
||||
border: CellBordersLayout | None
|
||||
|
||||
def write(self, text, align: Incomplete | None = None): ...
|
||||
def write(self, text, align=None): ...
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RowLayoutInfo:
|
||||
@@ -144,4 +136,4 @@ class RowSpanLayoutInfo:
|
||||
|
||||
def row_range(self) -> range: ...
|
||||
|
||||
def draw_box_borders(pdf: FPDF, x1, y1, x2, y2, border: str | Literal[0, 1], fill_color: Incomplete | None = None) -> None: ...
|
||||
def draw_box_borders(pdf: FPDF, x1, y1, x2, y2, border: str | Literal[0, 1], fill_color=None) -> None: ...
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from _typeshed import Incomplete
|
||||
from os import PathLike
|
||||
from typing import Any
|
||||
|
||||
@@ -11,7 +10,7 @@ class FlexTemplate:
|
||||
splitting_pdf: Any
|
||||
handlers: Any
|
||||
texts: Any
|
||||
def __init__(self, pdf, elements: Incomplete | None = None) -> None: ...
|
||||
def __init__(self, pdf, elements=None) -> None: ...
|
||||
elements: Any
|
||||
keys: Any
|
||||
def load_elements(self, elements) -> None: ...
|
||||
@@ -29,8 +28,8 @@ class FlexTemplate:
|
||||
class Template(FlexTemplate):
|
||||
def __init__(
|
||||
self,
|
||||
infile: Incomplete | None = None,
|
||||
elements: Incomplete | None = None,
|
||||
infile=None,
|
||||
elements=None,
|
||||
format: str = "A4",
|
||||
orientation: str = "portrait",
|
||||
unit: str = "mm",
|
||||
@@ -41,4 +40,4 @@ class Template(FlexTemplate):
|
||||
keywords: str = "",
|
||||
) -> None: ...
|
||||
def add_page(self) -> None: ...
|
||||
def render(self, outfile: Incomplete | None = None, dest: Incomplete | None = None) -> None: ... # type: ignore[override]
|
||||
def render(self, outfile=None, dest=None) -> None: ... # type: ignore[override]
|
||||
|
||||
@@ -47,7 +47,7 @@ class Paragraph:
|
||||
self,
|
||||
region,
|
||||
text_align: _TextAlign | None = None,
|
||||
line_height: Incomplete | None = None,
|
||||
line_height=None,
|
||||
top_margin: float = 0,
|
||||
bottom_margin: float = 0,
|
||||
indent: float = 0,
|
||||
@@ -59,7 +59,7 @@ class Paragraph:
|
||||
) -> None: ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
|
||||
def write(self, text: str, link: Incomplete | None = None): ...
|
||||
def write(self, text: str, link=None): ...
|
||||
def generate_bullet_frags_and_tl(
|
||||
self, bullet_string: str, bullet_r_margin: float
|
||||
) -> tuple[tuple[Fragment, ...], TextLine] | None: ...
|
||||
@@ -93,9 +93,9 @@ class ImageParagraph:
|
||||
keep_aspect_ratio: bool = False,
|
||||
top_margin: float = 0,
|
||||
bottom_margin: float = 0,
|
||||
link: Incomplete | None = None,
|
||||
title: Incomplete | None = None,
|
||||
alt_text: Incomplete | None = None,
|
||||
link=None,
|
||||
title=None,
|
||||
alt_text=None,
|
||||
) -> None: ...
|
||||
def build_line(self) -> Self: ...
|
||||
def render(self, col_left: float, col_width: float, max_height: float) -> VectorImageInfo | RasterImageInfo: ...
|
||||
@@ -117,18 +117,18 @@ class ParagraphCollectorMixin:
|
||||
print_sh: bool = False,
|
||||
skip_leading_spaces: bool = False,
|
||||
wrapmode: WrapMode | None = None,
|
||||
img: Incomplete | None = None,
|
||||
img=None,
|
||||
img_fill_width: bool = False,
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
|
||||
def write(self, text: str, link: Incomplete | None = None): ...
|
||||
def write(self, text: str, link=None): ...
|
||||
def ln(self, h: float | None = None) -> None: ...
|
||||
def paragraph(
|
||||
self,
|
||||
text_align: _TextAlign | None = None,
|
||||
line_height: Incomplete | None = None,
|
||||
line_height=None,
|
||||
skip_leading_spaces: bool = False,
|
||||
top_margin: int = 0,
|
||||
bottom_margin: int = 0,
|
||||
@@ -149,9 +149,9 @@ class ParagraphCollectorMixin:
|
||||
keep_aspect_ratio: bool = False,
|
||||
top_margin: float = 0,
|
||||
bottom_margin: float = 0,
|
||||
link: Incomplete | None = None,
|
||||
title: Incomplete | None = None,
|
||||
alt_text: Incomplete | None = None,
|
||||
link=None,
|
||||
title=None,
|
||||
alt_text=None,
|
||||
) -> None: ...
|
||||
|
||||
class TextRegion(ParagraphCollectorMixin):
|
||||
@@ -163,7 +163,7 @@ class TextRegion(ParagraphCollectorMixin):
|
||||
class TextColumnarMixin:
|
||||
l_margin: Incomplete
|
||||
r_margin: Incomplete
|
||||
def __init__(self, pdf, *args, l_margin: Incomplete | None = None, r_margin: Incomplete | None = None, **kwargs) -> None: ...
|
||||
def __init__(self, pdf, *args, l_margin=None, r_margin=None, **kwargs) -> None: ...
|
||||
|
||||
class TextColumns(TextRegion, TextColumnarMixin):
|
||||
balance: Incomplete
|
||||
|
||||
Reference in New Issue
Block a user