-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94e4fd0
commit f407bd1
Showing
42 changed files
with
935 additions
and
2,669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { SimpleType, SimpleTypeKind } from '@agoraio-extensions/cxx-parser'; | ||
import { | ||
UpdateNodeConfig, | ||
updateSimpleTypeName, | ||
} from '@agoraio-extensions/terra_shared_configs'; | ||
|
||
module.exports = { | ||
'^Optional<(.*)>': '$1', | ||
'^(.*)::(.*)': '$2', | ||
'^AString$': 'string', | ||
'^user_id_t$': 'string', | ||
'^view_t$': 'any', | ||
'^view_t\\*$': 'any[]', | ||
'^uid_t$': 'number', | ||
'^const uid_t\\*$': 'number[]', | ||
'^track_id_t$': 'number', | ||
'^video_track_id_t$': 'number', | ||
'^conn_id_t$': 'number', | ||
'^char$': 'number', | ||
'^unsigned int$': 'number', | ||
'^size_t$': 'number', | ||
'^unsigned short$': 'number', | ||
'^unsigned char$': 'number', | ||
'^float$': 'number', | ||
'^double$': 'number', | ||
'^int(.*)_t$': 'number', | ||
'^uint(.*)_t$': 'number', | ||
'^long$': 'number', | ||
'^long long$': 'number', | ||
'^int$': 'number', | ||
'^bool$': 'boolean', | ||
'^intptr_t$': 'number', | ||
'^uintptr_t$': 'number', | ||
'^const char \\*$': 'string', | ||
'^IMetadata': 'RtmMetadata', | ||
'customHook': (node: SimpleType, configs: UpdateNodeConfig) => { | ||
let type = node.name; | ||
if (!type) { | ||
type = node.source; | ||
} | ||
switch (node.asSimpleType().kind) { | ||
case SimpleTypeKind.value_t: | ||
type = updateSimpleTypeName(type, configs); | ||
break; | ||
case SimpleTypeKind.pointer_t: | ||
if (type == 'char') { | ||
if (node.source.endsWith('**')) { | ||
type = 'string[]'; | ||
} else { | ||
type = 'string'; | ||
} | ||
} else if (type == 'uint8_t' || type == 'unsigned char') { | ||
type = 'Uint8Array'; | ||
} else if (type == 'void') { | ||
type = 'any'; | ||
} else { | ||
type = updateSimpleTypeName(type, configs); | ||
} | ||
break; | ||
case SimpleTypeKind.reference_t: | ||
type = updateSimpleTypeName(type, configs); | ||
break; | ||
case SimpleTypeKind.array_t: | ||
if (type == 'char') { | ||
if (node.source.endsWith('**')) { | ||
type = 'string[]'; | ||
} else { | ||
type = 'string'; | ||
} | ||
} else if (type == 'void') { | ||
type = 'Uint8Array'; | ||
} else { | ||
type = updateSimpleTypeName(type, configs) + '[]'; | ||
} | ||
break; | ||
case SimpleTypeKind.template_t: | ||
type = updateSimpleTypeName(node.template_arguments[0]!, configs); | ||
break; | ||
default: | ||
type = updateSimpleTypeName(type, configs); | ||
break; | ||
} | ||
return type; | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { SimpleTypeKind } from '@agoraio-extensions/cxx-parser'; | ||
|
||
module.exports = { | ||
'agora::rtm::IStreamChannel.getSubscribedUserList': { | ||
name: 'agora::rtm::UserList', | ||
source: 'agora::rtm::UserList*', | ||
kind: SimpleTypeKind.array_t, | ||
is_const: false, | ||
is_builtin_type: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = [ | ||
'agora::rtm::IRtmPresence.setState.items', | ||
'agora::rtm::IRtmEventHandler.onWhereNowResult.channels', | ||
'agora::rtm::IRtmEventHandler.onGetUserChannelsResult.channels', | ||
'agora::rtm::IChannelEventHandler.onMembersGotten.members', | ||
'agora::rtm::IStreamChannel.unsubscribeTopic.options', | ||
'agora::rtm::IChannelEventHandler.onAttributesUpdated.attributes', | ||
'agora::rtm::IChannelEventHandler.onAttributesDeleted.attributes', | ||
'agora::rtm::IChannelEventHandler.updateAttributes.attributes', | ||
]; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = [ | ||
'agora::rtm::IMetadata', | ||
'agora::rtm::IStreamChannel.getSubscribedUserList.users', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -x | ||
|
||
MY_PATH=$(realpath $(dirname "$0")) | ||
PROJECT_ROOT=$(realpath ${MY_PATH}/../..) | ||
|
||
npm exec terra -- run \ | ||
--config ${PROJECT_ROOT}/scripts/terra/config/types_config.yaml \ | ||
--output-dir=${PROJECT_ROOT}/src | ||
|
||
npm exec terra -- run \ | ||
--config ${PROJECT_ROOT}/scripts/terra/config/impl_config.yaml \ | ||
--output-dir=${PROJECT_ROOT}/src | ||
|
||
cd ${PROJECT_ROOT} | ||
|
||
yarn exec eslint --fix --ext .ts ./src |
Oops, something went wrong.