mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
Typing: improve kivy type stubs (#2681)
This commit is contained in:
@@ -1,24 +1,12 @@
|
|||||||
""" FillType_* is not a real kivy type - just something to fill unknown typing. """
|
from .texture import FillType_Drawable, FillType_Vec, Texture
|
||||||
|
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
FillType_Vec = Sequence[int]
|
|
||||||
|
|
||||||
|
|
||||||
class FillType_Drawable:
|
|
||||||
def __init__(self, *, pos: FillType_Vec = ..., size: FillType_Vec = ...) -> None: ...
|
|
||||||
|
|
||||||
|
|
||||||
class FillType_Texture(FillType_Drawable):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class FillType_Shape(FillType_Drawable):
|
class FillType_Shape(FillType_Drawable):
|
||||||
texture: FillType_Texture
|
texture: Texture
|
||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
*,
|
*,
|
||||||
texture: FillType_Texture = ...,
|
texture: Texture = ...,
|
||||||
pos: FillType_Vec = ...,
|
pos: FillType_Vec = ...,
|
||||||
size: FillType_Vec = ...) -> None: ...
|
size: FillType_Vec = ...) -> None: ...
|
||||||
|
|
||||||
@@ -35,6 +23,6 @@ class Rectangle(FillType_Shape):
|
|||||||
def __init__(self,
|
def __init__(self,
|
||||||
*,
|
*,
|
||||||
source: str = ...,
|
source: str = ...,
|
||||||
texture: FillType_Texture = ...,
|
texture: Texture = ...,
|
||||||
pos: FillType_Vec = ...,
|
pos: FillType_Vec = ...,
|
||||||
size: FillType_Vec = ...) -> None: ...
|
size: FillType_Vec = ...) -> None: ...
|
13
typings/kivy/graphics/texture.pyi
Normal file
13
typings/kivy/graphics/texture.pyi
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
""" FillType_* is not a real kivy type - just something to fill unknown typing. """
|
||||||
|
|
||||||
|
from typing import Sequence
|
||||||
|
|
||||||
|
FillType_Vec = Sequence[int]
|
||||||
|
|
||||||
|
|
||||||
|
class FillType_Drawable:
|
||||||
|
def __init__(self, *, pos: FillType_Vec = ..., size: FillType_Vec = ...) -> None: ...
|
||||||
|
|
||||||
|
|
||||||
|
class Texture:
|
||||||
|
pass
|
9
typings/kivy/uix/image.pyi
Normal file
9
typings/kivy/uix/image.pyi
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import io
|
||||||
|
|
||||||
|
from kivy.graphics.texture import Texture
|
||||||
|
|
||||||
|
|
||||||
|
class CoreImage:
|
||||||
|
texture: Texture
|
||||||
|
|
||||||
|
def __init__(self, data: io.BytesIO, ext: str) -> None: ...
|
Reference in New Issue
Block a user