Skip to content

Commit

Permalink
typing improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
FredHappyface committed Feb 19, 2025
1 parent 0078c99 commit 218cd0d
Show file tree
Hide file tree
Showing 37 changed files with 280 additions and 287 deletions.
4 changes: 2 additions & 2 deletions documentation/reference/gimpformats/GimpChannel.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Decode a byte buffer.
#### Arguments

----
- `data` *bytes* - data to decode
- `data` *bytearray* - data to decode
- `index` *int, optional* - index to start from. Defaults to 0.

#### Returns
Expand All @@ -65,7 +65,7 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes | bytearray, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpChannel().encode
Expand Down
4 changes: 2 additions & 2 deletions documentation/reference/gimpformats/GimpGbrBrush.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Decode a byte buffer.
#### Arguments

----
- `data` *bytes* - data buffer to decode
- `data` *bytearray* - data buffer to decode
- `index` *int, optional* - index within the buffer to start at. Defaults to 0.

#### Raises
Expand All @@ -69,7 +69,7 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpGbrBrush().encode
Expand Down
8 changes: 4 additions & 4 deletions documentation/reference/gimpformats/GimpGgrGradient.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Decode a byte buffer.
#### Arguments

----
- `dataIn` *bytes* - data buffer to decode
- `dataIn` *bytearray* - data buffer to decode

#### Raises

Expand All @@ -67,19 +67,19 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, dataIn: bytes) -> None: ...
def decode(self, dataIn: bytearray) -> None: ...
```

### GimpGgrGradient().encode

[Show source in GimpGgrGradient.py:175](../../../gimpformats/GimpGgrGradient.py#L175)

Encode this to bytes.
Encode this to bytearray.

#### Signature

```python
def encode(self) -> bytes: ...
def encode(self) -> bytearray: ...
```

### GimpGgrGradient().full_repr
Expand Down
8 changes: 4 additions & 4 deletions documentation/reference/gimpformats/GimpGihBrushSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Decode a byte buffer.
#### Arguments

----
- `data` *bytes* - data buffer to decode
- `data` *bytearray* - data buffer to decode
- `index` *int, optional* - index within the buffer to start at. Defaults to 0.

#### Returns
Expand All @@ -64,19 +64,19 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpGihBrushSet().encode

[Show source in GimpGihBrushSet.py:81](../../../gimpformats/GimpGihBrushSet.py#L81)

Encode this object to bytes.
Encode this object to bytearray.

#### Signature

```python
def encode(self) -> bytes: ...
def encode(self) -> bytearray: ...
```

### GimpGihBrushSet().full_repr
Expand Down
8 changes: 4 additions & 4 deletions documentation/reference/gimpformats/GimpGpbBrush.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Decode a byte buffer.
#### Arguments

----
- `data` *bytes* - data to decode
- `data` *bytearray* - data to decode
- `index` *int, optional* - index to start from. Defaults to 0.

#### Returns
Expand All @@ -74,19 +74,19 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpGpbBrush().encode

[Show source in GimpGpbBrush.py:60](../../../gimpformats/GimpGpbBrush.py#L60)

Encode this object to bytes.
Encode this object to bytearray.

#### Signature

```python
def encode(self) -> bytes | bytearray: ...
def encode(self) -> bytearray: ...
```

### GimpGpbBrush().full_repr
Expand Down
2 changes: 1 addition & 1 deletion documentation/reference/gimpformats/GimpGplPalette.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Encode to a raw data stream.
#### Signature

```python
def encode(self) -> bytes: ...
def encode(self) -> bytearray: ...
```

### GimpGplPalette().full_repr
Expand Down
8 changes: 4 additions & 4 deletions documentation/reference/gimpformats/GimpGtpToolPreset.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpGtpToolPreset().encode

[Show source in GimpGtpToolPreset.py:157](../../../gimpformats/GimpGtpToolPreset.py#L157)

Encode to bytes.
Encode to bytearray.

#### Signature

```python
def encode(self) -> bytes: ...
def encode(self) -> bytearray: ...
```

### GimpGtpToolPreset().full_repr
Expand Down Expand Up @@ -195,7 +195,7 @@ Decode a parentheses-based file format.
#### Signature

```python
def parenFileDecode(data: bytes) -> list[ParenFileValue]: ...
def parenFileDecode(data: bytearray) -> list[ParenFileValue]: ...
```

#### See also
Expand Down
24 changes: 12 additions & 12 deletions documentation/reference/gimpformats/GimpIOBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ _colormapDecode_.

#### Arguments

- `data` - can be bytes or an IO object
- `data` - can be bytearray or an IO object

decode colormap/palette

#### Signature

```python
def _colormapDecode(self, data: bytes | bytearray | IO, index: int = 0) -> None: ...
def _colormapDecode(self, data: bytearray | IO, index: int = 0) -> None: ...
```

### GimpIOBase()._guidelinesDecode
Expand All @@ -166,7 +166,7 @@ Decode guidelines.
#### Signature

```python
def _guidelinesDecode(self, data: bytes | bytearray) -> None: ...
def _guidelinesDecode(self, data: bytearray) -> None: ...
```

### GimpIOBase()._itemPathDecode
Expand All @@ -178,7 +178,7 @@ Decode item path.
#### Signature

```python
def _itemPathDecode(self, data: bytes | bytearray) -> None: ...
def _itemPathDecode(self, data: bytearray) -> None: ...
```

### GimpIOBase()._parasitesDecode
Expand All @@ -190,7 +190,7 @@ Decode list of parasites.
#### Signature

```python
def _parasitesDecode(self, data: bytes | bytearray) -> int: ...
def _parasitesDecode(self, data: bytearray) -> int: ...
```

### GimpIOBase()._parasitesEncode
Expand Down Expand Up @@ -247,7 +247,7 @@ data: varies but is often ioBuf.32 or ioBuf.boolean
#### Signature

```python
def _propertyDecode(self, prop: int, data: bytes | bytearray) -> int: ...
def _propertyDecode(self, prop: int, data: bytearray) -> int: ...
```

### GimpIOBase()._propertyEncode
Expand Down Expand Up @@ -278,7 +278,7 @@ Decode a series of points.
#### Signature

```python
def _samplePointsDecode(self, data: bytes | bytearray) -> None: ...
def _samplePointsDecode(self, data: bytearray) -> None: ...
```

### GimpIOBase()._userUnitsDecode
Expand All @@ -290,7 +290,7 @@ Decode a set of user-defined measurement units.
#### Signature

```python
def _userUnitsDecode(self, data: bytes | bytearray) -> None: ...
def _userUnitsDecode(self, data: bytearray) -> None: ...
```

### GimpIOBase()._vectorsDecode
Expand All @@ -302,7 +302,7 @@ Decode vectors.
#### Signature

```python
def _vectorsDecode(self, data: bytes | bytearray) -> None: ...
def _vectorsDecode(self, data: bytearray) -> None: ...
```

### GimpIOBase().activeVector
Expand Down Expand Up @@ -463,7 +463,7 @@ Decode a byte buffer.
#### Arguments

----
- `data` *bytes* - data buffer to decode
- `data` *bytearray* - data buffer to decode
- `index` *int, optional* - index within the buffer to start at]. Defaults to 0.

#### Returns
Expand All @@ -474,14 +474,14 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes | bytearray, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpUserUnits().encode

[Show source in GimpIOBase.py:835](../../../gimpformats/GimpIOBase.py#L835)

Convert this object to raw bytes.
Convert this object to raw bytearray.

#### Signature

Expand Down
2 changes: 1 addition & 1 deletion documentation/reference/gimpformats/GimpImageHierarchy.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Decode packed pixels from a byte buffer.
#### Signature

```python
def decode(self, data: bytes, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpImageHierarchy().encode
Expand Down
2 changes: 1 addition & 1 deletion documentation/reference/gimpformats/GimpImageLevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpImageLevel().encode
Expand Down
4 changes: 2 additions & 2 deletions documentation/reference/gimpformats/GimpLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Return the offset
#### Arguments

----
- `data` *bytes* - data buffer to decode
- `data` *bytearray* - data buffer to decode
- `index` *int, optional* - index within the buffer to start at]. Defaults to 0.

#### Returns
Expand All @@ -88,7 +88,7 @@ Return the offset
#### Signature

```python
def decode(self, data: bytes | bytearray, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpLayer().encode
Expand Down
2 changes: 1 addition & 1 deletion documentation/reference/gimpformats/GimpParasites.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpParasite().encode
Expand Down
4 changes: 2 additions & 2 deletions documentation/reference/gimpformats/GimpPatPattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Decode a byte buffer.
#### Arguments

----
- `data` *bytes* - data to decode
- `data` *bytearray* - data to decode
- `index` *int, optional* - index to start from. Defaults to 0.

#### Raises
Expand All @@ -81,7 +81,7 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, data: bytes, index: int = 0) -> int: ...
def decode(self, data: bytearray, index: int = 0) -> int: ...
```

### GimpPatPattern().encode
Expand Down
4 changes: 2 additions & 2 deletions documentation/reference/gimpformats/GimpVbrBrush.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Decode a byte buffer.
#### Signature

```python
def decode(self, dataIn: bytes) -> None: ...
def decode(self, dataIn: bytearray) -> None: ...
```

### GimpVbrBrush().encode
Expand All @@ -92,7 +92,7 @@ Encode to a raw data stream.
#### Signature

```python
def encode(self) -> bytes: ...
def encode(self) -> bytearray: ...
```

### GimpVbrBrush().image
Expand Down
Loading

0 comments on commit 218cd0d

Please sign in to comment.