from typing import Any

from django.db.migrations.migration import Migration
from django.db.migrations.operations.base import Operation
from django.db.migrations.serializer import BaseSerializer

class OperationWriter:
    operation: Operation
    buff: list[Any]
    indentation: int
    def __init__(self, operation: Operation, indentation: int = 2) -> None: ...
    def serialize(self) -> tuple[str, set[str]]: ...
    def indent(self) -> None: ...
    def unindent(self) -> None: ...
    def feed(self, line: str) -> None: ...
    def render(self) -> str: ...

class MigrationWriter:
    migration: Migration
    needs_manual_porting: bool
    def __init__(self, migration: Migration, include_header: bool = True) -> None: ...
    def as_string(self) -> str: ...
    @property
    def basedir(self) -> str: ...
    @property
    def filename(self) -> str: ...
    @property
    def path(self) -> str: ...
    @classmethod
    def serialize(cls, value: Any) -> tuple[str, set[str]]: ...
    @classmethod
    def register_serializer(cls, type_: type, serializer: type[BaseSerializer]) -> None: ...
    @classmethod
    def unregister_serializer(cls, type_: type) -> None: ...

MIGRATION_HEADER_TEMPLATE: str
MIGRATION_TEMPLATE: str
