mirror of
https://github.com/erg-lang/erg.git
synced 2025-07-07 13:15:21 +00:00
feat: add type decl files
This commit is contained in:
parent
0076174a22
commit
093bf73d70
5 changed files with 82 additions and 0 deletions
5
crates/erg_compiler/lib/pystd/locale.d.er
Normal file
5
crates/erg_compiler/lib/pystd/locale.d.er
Normal file
|
@ -0,0 +1,5 @@
|
|||
.Error: ClassType
|
||||
.Error <: Exception
|
||||
|
||||
.setlocale!: (category: Int, locale := Str or Iterable(Str)) => NoneType
|
||||
.localeconv: () -> {Str: Int or List(Obj) or Str}
|
0
crates/erg_compiler/lib/pystd/secrets.d.er
Normal file
0
crates/erg_compiler/lib/pystd/secrets.d.er
Normal file
46
crates/erg_compiler/lib/pystd/signal.d.er
Normal file
46
crates/erg_compiler/lib/pystd/signal.d.er
Normal file
|
@ -0,0 +1,46 @@
|
|||
{IntEnum;} = pyimport "enum"
|
||||
|
||||
.SIG_DFL: .Signals
|
||||
.SIG_IGN: .Signals
|
||||
.SIGALRM: .Signals
|
||||
.SIGBREAK: .Signals
|
||||
.SIGBUS: .Signals
|
||||
.SIGCHLD: .Signals
|
||||
.SIGCLD: .Signals
|
||||
.SIGCONT: .Signals
|
||||
.SIGFPE: .Signals
|
||||
.SIGHUP: .Signals
|
||||
.SIGILL: .Signals
|
||||
.SIGINT: .Signals
|
||||
.SIGKILL: .Signals
|
||||
.SIGPIPE: .Signals
|
||||
.SIGSEGV: .Signals
|
||||
.SIGSTKFLT: .Signals
|
||||
.SIGTERM: .Signals
|
||||
.SIGUSR1: .Signals
|
||||
.SIGUSR2: .Signals
|
||||
.SIGWINCH: .Signals
|
||||
.CTRL_C_EVENT: .Signals
|
||||
.CTRL_BREAK_EVENT: .Signals
|
||||
.NSIG: .Signals
|
||||
.ITIMER_REAL: .Signals
|
||||
.ITIMER_VIRTUAL: .Signals
|
||||
.ITIMER_PROF: .Signals
|
||||
.SIG_BLOCK: .Signals
|
||||
.SIG_UNBLOCK: .Signals
|
||||
.SIG_SETMASK: .Signals
|
||||
|
||||
.Signals: ClassType
|
||||
.Signals <: IntEnum
|
||||
|
||||
.Handlers: ClassType
|
||||
.Handlers <: IntEnum
|
||||
|
||||
.Sigmasks: ClassType
|
||||
.Sigmasks <: IntEnum
|
||||
|
||||
.alarm!: (time: Int) => Int
|
||||
.getsignal: (signal: .Signals) -> Obj
|
||||
.strsignal: (signal: .Signals) -> Str
|
||||
.pause!: () => NoneType
|
||||
.signal!: (signal: .Signals, handler: GenericCallable) => .Handlers
|
26
crates/erg_compiler/lib/pystd/trace.d.er
Normal file
26
crates/erg_compiler/lib/pystd/trace.d.er
Normal file
|
@ -0,0 +1,26 @@
|
|||
.Trace!: ClassType
|
||||
.Trace!.
|
||||
__call__: (
|
||||
count := Nat,
|
||||
trace := Nat,
|
||||
countfuncs := Nat,
|
||||
countcallers := Nat,
|
||||
ignoremods := Iterable(Str),
|
||||
ignoredirs := Iterable(Str),
|
||||
infile := Str,
|
||||
outfile := Str,
|
||||
timing := Bool,
|
||||
) -> Trace!
|
||||
run!: (self: RefMut(Trace!), cmd: Str) => NoneType
|
||||
results: (self: Ref(Trace!)) -> CoverageResults!
|
||||
|
||||
.CoverageResults!: ClassType
|
||||
.CoverageResults!.
|
||||
update!: (self: RefMut(CoverageResults!), other: CoverageResults!) => NoneType
|
||||
write_results!: (
|
||||
self: Ref(CoverageResults!),
|
||||
show_missing := Bool,
|
||||
summary := Bool,
|
||||
coverdir := Str,
|
||||
ignore_missing_files := Bool,
|
||||
) => NoneType
|
5
crates/erg_compiler/lib/pystd/weakref.d.er
Normal file
5
crates/erg_compiler/lib/pystd/weakref.d.er
Normal file
|
@ -0,0 +1,5 @@
|
|||
.ReferenceType: (T: Type) -> ClassType
|
||||
.ReferenceType(T).
|
||||
__call__: (self: .ReferenceType(T)) -> T
|
||||
|
||||
.ref: |T|(obj: T) -> ReferenceType T
|
Loading…
Add table
Add a link
Reference in a new issue