mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Add stubs for libsass (#10638)
This commit is contained in:
0
stubs/libsass/sassutils/__init__.pyi
Normal file
0
stubs/libsass/sassutils/__init__.pyi
Normal file
34
stubs/libsass/sassutils/builder.pyi
Normal file
34
stubs/libsass/sassutils/builder.pyi
Normal file
@@ -0,0 +1,34 @@
|
||||
from collections.abc import Mapping
|
||||
from re import Pattern
|
||||
from typing import Any
|
||||
|
||||
from sass import _OutputStyle
|
||||
|
||||
SUFFIXES: frozenset[str]
|
||||
SUFFIX_PATTERN: Pattern[str]
|
||||
|
||||
def build_directory(
|
||||
sass_path: str,
|
||||
css_path: str,
|
||||
output_style: _OutputStyle = "nested",
|
||||
_root_sass: None = None, # internal arguments for recursion
|
||||
_root_css: None = None, # internal arguments for recursion
|
||||
strip_extension: bool = False,
|
||||
) -> dict[str, str]: ...
|
||||
|
||||
class Manifest:
|
||||
@classmethod
|
||||
def normalize_manifests(
|
||||
cls, manifests: Mapping[str, Manifest | tuple[Any, ...] | Mapping[str, Any] | str] | None
|
||||
) -> dict[str, Manifest]: ...
|
||||
sass_path: str
|
||||
css_path: str
|
||||
wsgi_path: str
|
||||
strip_extension: bool
|
||||
def __init__(
|
||||
self, sass_path: str, css_path: str | None = None, wsgi_path: str | None = None, strip_extension: bool | None = None
|
||||
) -> None: ...
|
||||
def resolve_filename(self, package_dir: str, filename: str) -> tuple[str, str]: ...
|
||||
def unresolve_filename(self, package_dir: str, filename: str) -> str: ...
|
||||
def build(self, package_dir: str, output_style: _OutputStyle = "nested") -> frozenset[str]: ...
|
||||
def build_one(self, package_dir: str, filename: str, source_map: bool = False) -> str: ...
|
||||
14
stubs/libsass/sassutils/distutils.pyi
Normal file
14
stubs/libsass/sassutils/distutils.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from sassutils.builder import Manifest as Manifest
|
||||
from setuptools import Command, Distribution
|
||||
|
||||
def validate_manifests(dist: Distribution, attr: str, value: object) -> None: ...
|
||||
|
||||
class build_sass(Command):
|
||||
description: str
|
||||
user_options: list[tuple[str, str, str]]
|
||||
package_dir: dict[str, str] | None
|
||||
output_style: str
|
||||
def initialize_options(self) -> None: ...
|
||||
def finalize_options(self) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
def get_package_dir(self, package: str) -> str: ...
|
||||
22
stubs/libsass/sassutils/wsgi.pyi
Normal file
22
stubs/libsass/sassutils/wsgi.pyi
Normal file
@@ -0,0 +1,22 @@
|
||||
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Any
|
||||
|
||||
from sassutils.builder import Manifest
|
||||
|
||||
class SassMiddleware:
|
||||
app: WSGIApplication
|
||||
manifests: dict[str, Manifest]
|
||||
error_status: str
|
||||
package_dir: Mapping[str, str]
|
||||
paths: list[tuple[str, str, Manifest]]
|
||||
def __init__(
|
||||
self,
|
||||
app: WSGIApplication,
|
||||
manifests: Mapping[str, Manifest | tuple[Any, ...] | Mapping[str, Any] | str] | None,
|
||||
package_dir: Mapping[str, str] = {},
|
||||
error_status: str = "200 OK",
|
||||
) -> None: ...
|
||||
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
|
||||
@staticmethod
|
||||
def quote_css_string(s: str) -> str: ...
|
||||
Reference in New Issue
Block a user