-
-
Notifications
You must be signed in to change notification settings - Fork 0
class_extensions
j-show edited this page Mar 1, 2019
·
1 revision
- Note
- Based on the ES6 specification, the underlying class is generated
- Extended exception handling mechanism
- Extended Event Mount processing mechanism
- Class Function
-
create()
- Note
- Class object Initialization
- Return
- object
- Note
-
- Object Function
-
free()
- Note
- Class object Release
- Note
-
on(key, func)
- Note
- Event bind
- Parameters
-
key
Event name -
func
Event function
-
- Return
- this
- Note
-
off([key], [func])
- Note
- Event unbind
- Parameters
-
key
Event name -
func
Event function- When Func is not empty, the key event is traversed to remove a specific callback function
- Delete all key events when Func is empty
- Delete all binding events when parameters is empty
-
- Return
- this
- Note
-
async call(key, [arg...])
- Note
- Triggers an event that is handled in a await manner when the callback content contains an asynchronous function
- Parameters
-
key
Event name -
arg
When an event is triggered, the parameter is substituting
-
- Return
- this
- Note
-
getError(index)
- Note
- Get error messages
- Parameters
-
index
Error Record index
-
- Return
-
{level,code,msg}
Error message object-
level
Error level,log/info/error -
code
Error code -
msg
Error message
-
-
- Note
-
setError(level, code, msg)
- Note
- Set up error messages and trigger the error event
- Parameters
-
level
Error level,log/info/error -
code
Error code -
msg
Error message
-
- Return
-
{level,code,msg}
Error message object-
level
Error level,log/info/error -
code
Error code -
msg
Error message
-
-
- Note
-
clearError()
- Note
- Clear error message object list
- Return
- this
- Note
-
- Property
-
className
- Note
- Class name, subsequent all subclasses need to be overwritten with their own class name
- By rewriting __className in the constructor function
- Class name, subsequent all subclasses need to be overwritten with their own class name
- Readonly
- Return
- string
- Note
-
errorMax
- Note
- Error Record maximum value
- Read & Write
- Return
- number
- Note
-
lastError
- Note
- Last Error logging
- Readonly
- Return
-
{level,code,msg}
Error message object-
level
Error level,log/info/error -
code
Error code -
msg
Error message
-
-
- Note
-
- Note
- The underlying class that is generated in the form of a function mount
- Extended exception handling mechanism,with TObject
- Extended event mount processing mechanism, with TObject
- Class Function
-
extend(childAPI)
- Note
- Inherit with Childapi as a subkey (deep copy mode))
- Parameters
-
childAPI
API Collection Objects
-
- Return
- class function
- Note
-
- Object Function
-
clone()
- Note
- Copy the class object itself, including the property content and status of the currently changed
- Note
-
- Note
- Cache processing classes that recycle caches based on buffer objects
- Inherited from
TObject
- Class Function
-
alloc([max=128])
- Note
- Create TCache object
- Parameters
-
max
cache max size
-
- Return
- Return TCache object
- Note
-
- Object Function
-
valueOf()
- Note
- Object Real Value,Buffer object
- Return
- Return Buffer object
- Note
-
resize([force=false])
- Note
- Adjust cached data block locations, similar to memory collation
- Parameters
-
force=false
Whether to force memory collation- force=false,Detects the presence of data and moves the block position to the cache header, idle out of the unused area of the tail
-
- Return
- Return Remaining space size
- Note
-
clear()
- Note
- Clear cache object
- Return
- Return TCache object
- Note
-
push(buf)
- Note
- Populate data
- Parameters
-
buf
Populate target data, buffer objects
-
- Return
- Return TCache object
- Note
-
remove(size)
- Note
- Delete data and delete from the header of available data
- Parameters
-
size
Delete the number of data
-
- Return
- Return TCache object
- Note
-
- Property
-
max
- Note
- Cache size, Unit bytes
- Readonly
- Return
- number
- Note
-
index
- Note
- Data Start location
- Readonly
- Return
- number
- Note
-
length
- Note
- Data size, Unit bytes
- Readonly
- Return
- number
- Note
-
offset
- Note
- Available Cache start position
- Readonly
- Return
- number
- Note
-
surplus
- Note
- Available Cache Size
- Readonly
- Return
- number
- Note
-
- Note
- Queue processing base classes that extend queues based on array objects
- Derived queue, stack, generic queue, generic stack and other extended forms
- Inherited from
TObject
- Note
- Lunar Time processing class, conversion calculation of time based on date object
- Calculation of Tiangan, support, throttle and five lines related to the lunar calendar
- Inherited from
TObject
- Class Function
-
toString([fmt], [date])
- Note
- Time-to-turn string display
- Parameters
-
fmt=Y年(Z) M月 D T
String conversion format- Convert the toString function of the format with the TChinaDate object
-
date
Date object that needs to be converted, the default is the current time
-
- Return
- Return string
- Note
-
- Object Function
-
valueOf()
- Note
- Object Real Value
- Return
- Return number,getTime() of the built-in date object
- Note
-
getTime()
- Note
- Get the number of milliseconds for the current time
- Return
- Return number
- Note
-
setTime(dt)
- Note
- Set the current time to dt
- Parameters
-
dt
Target time- dt is number,Set the time as a millisecond
- dt is Date object,Set the time as date
-
- Return
- Return this
- Note
-
toString([fmt])
- Note
- Convert the current time to a string in fmt format
- Parameters
-
fmt=Y年(Z) M月 D T
String conversion format-
CY
Chinese Year -
CM
Chinese Month -
CD
Chinese Day -
Y
Year -
M
Month -
D
Day -
T
24 Term -
Z
Zodiac
-
-
- Return
- Return string
- Note
-
- Property
-
Year
- Note
- Year
- Readonly
- Return
- string
- Note
-
Month
- Note
- Month
- Readonly
- Return
- string
- Note
-
Day
- Note
- Day
- Readonly
- Return
- string
- Note
-
CYear
- Note
- Chinese Year
- Readonly
- Return
- string
- Note
-
CMonth
- Note
- Chinese Month
- Readonly
- Return
- string
- Note
-
CDay
- Note
- Chinese Day
- Readonly
- Return
- string
- Note
-
Term
- Note
- Term
- Readonly
- Return
- string
- Note
-
Zodiac
- Note
- Zodiac
- Readonly
- Return
- string
- Note
-
IsLeapYear
- Note
- Whether the current year is a lunar leap years
- Readonly
- Return
- string
- Note
-
- Note
- GUID conversion class, unable to generate real GUID through hardware information, can only simulate data
- determination and conversion of GUID values
- Inherited from
TObject
- Class Function
-
toString()
- Note
- Get the new GUID and converts it into a string
- Return
- Return string
- Note
-
toByteArray()
- Note
- Get the new GUID and converts it into a byte array
- Return
- Return array
- Note
-
New()
- Note
- Get the new GUID
- Return
- Return TGuid object
- Note
-
- Object Function
-
valueOf()
- Note
- Object True value, similar to calling toString()
- Return
- Return string
- Note
-
toString()
- Note
- Convert to String
- Return
- Return string
- Note
-
toByteArray()
- Note
- Convert to byte array
- Return
- Return array
- Note
-
New()
- Note
- Generate a new GUID, current this remains the same, replace the content
- Return
- Return this
- Note
-
- Note
- Queue functions that can qualify queue types by type
- Parameters
-
type
Qualified type, which can be a string value of the type
-
- Return
- Return TList object
- Note
- Lunar time function, based on Tchinadate object
- Basic operation simulates the Date object
- Parameters
-
dt
Bring the time value as the current time, which can be Number type
-
- Return
- Return TChinaDate object
- Note
- Generate GUID to generate GUID by simulating
- GUID value is a random number that conforms to the rule and is hardware-independent
- Return
- Return TGuid object
- Note
- Generate GUID to generate GUID by simulating
- GUID value is 0
- Return
- Return TGuid object
- WebBrowser
- Node.js