/** * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). * * Do not edit this file as changes may cause incorrect behavior and will be lost * once the code is regenerated. * * @generated by codegen project: GenerateComponentHObjCpp.js */ #import #import #import NS_ASSUME_NONNULL_BEGIN @protocol RCTEnrichedMarkdownViewProtocol @end @protocol RCTEnrichedMarkdownTextInputViewProtocol - (void)focus; - (void)blur; - (void)setValue:(NSString *)markdown; - (void)setSelection:(NSInteger)start end:(NSInteger)end; - (void)toggleBold; - (void)toggleItalic; - (void)toggleUnderline; - (void)toggleStrikethrough; - (void)toggleSpoiler; - (void)toggleHeading:(NSInteger)level; - (void)toggleUnorderedList; - (void)toggleOrderedList; - (void)indentList; - (void)outdentList; - (void)setLink:(NSString *)url; - (void)insertLink:(NSString *)text url:(NSString *)url; - (void)insertText:(NSString *)text; - (void)insertMention:(NSString *)displayText url:(NSString *)url; - (void)startMention:(NSString *)indicator; - (void)removeLink; - (void)copyToClipboard; - (void)requestMarkdown:(NSInteger)requestId; - (void)requestCaretRect:(NSInteger)requestId; @end RCT_EXTERN inline void RCTEnrichedMarkdownTextInputHandleCommand( id componentView, NSString const *commandName, NSArray const *args) { if ([commandName isEqualToString:@"focus"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView focus]; return; } if ([commandName isEqualToString:@"blur"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView blur]; return; } if ([commandName isEqualToString:@"setValue"]) { #if RCT_DEBUG if ([args count] != 1) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 1); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSString * markdown = (NSString *)arg0; [componentView setValue:markdown]; return; } if ([commandName isEqualToString:@"setSelection"]) { #if RCT_DEBUG if ([args count] != 2) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 2); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSInteger start = [(NSNumber *)arg0 intValue]; NSObject *arg1 = args[1]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg1, [NSNumber class], @"number", @"EnrichedMarkdownTextInput", commandName, @"2nd")) { return; } #endif NSInteger end = [(NSNumber *)arg1 intValue]; [componentView setSelection:start end:end]; return; } if ([commandName isEqualToString:@"toggleBold"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView toggleBold]; return; } if ([commandName isEqualToString:@"toggleItalic"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView toggleItalic]; return; } if ([commandName isEqualToString:@"toggleUnderline"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView toggleUnderline]; return; } if ([commandName isEqualToString:@"toggleStrikethrough"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView toggleStrikethrough]; return; } if ([commandName isEqualToString:@"toggleSpoiler"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView toggleSpoiler]; return; } if ([commandName isEqualToString:@"toggleHeading"]) { #if RCT_DEBUG if ([args count] != 1) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 1); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSInteger level = [(NSNumber *)arg0 intValue]; [componentView toggleHeading:level]; return; } if ([commandName isEqualToString:@"toggleUnorderedList"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView toggleUnorderedList]; return; } if ([commandName isEqualToString:@"toggleOrderedList"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView toggleOrderedList]; return; } if ([commandName isEqualToString:@"indentList"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView indentList]; return; } if ([commandName isEqualToString:@"outdentList"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView outdentList]; return; } if ([commandName isEqualToString:@"setLink"]) { #if RCT_DEBUG if ([args count] != 1) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 1); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSString * url = (NSString *)arg0; [componentView setLink:url]; return; } if ([commandName isEqualToString:@"insertLink"]) { #if RCT_DEBUG if ([args count] != 2) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 2); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSString * text = (NSString *)arg0; NSObject *arg1 = args[1]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg1, [NSString class], @"string", @"EnrichedMarkdownTextInput", commandName, @"2nd")) { return; } #endif NSString * url = (NSString *)arg1; [componentView insertLink:text url:url]; return; } if ([commandName isEqualToString:@"insertText"]) { #if RCT_DEBUG if ([args count] != 1) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 1); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSString * text = (NSString *)arg0; [componentView insertText:text]; return; } if ([commandName isEqualToString:@"insertMention"]) { #if RCT_DEBUG if ([args count] != 2) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 2); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSString * displayText = (NSString *)arg0; NSObject *arg1 = args[1]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg1, [NSString class], @"string", @"EnrichedMarkdownTextInput", commandName, @"2nd")) { return; } #endif NSString * url = (NSString *)arg1; [componentView insertMention:displayText url:url]; return; } if ([commandName isEqualToString:@"startMention"]) { #if RCT_DEBUG if ([args count] != 1) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 1); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSString * indicator = (NSString *)arg0; [componentView startMention:indicator]; return; } if ([commandName isEqualToString:@"removeLink"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView removeLink]; return; } if ([commandName isEqualToString:@"copyToClipboard"]) { #if RCT_DEBUG if ([args count] != 0) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 0); return; } #endif [componentView copyToClipboard]; return; } if ([commandName isEqualToString:@"requestMarkdown"]) { #if RCT_DEBUG if ([args count] != 1) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 1); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSInteger requestId = [(NSNumber *)arg0 intValue]; [componentView requestMarkdown:requestId]; return; } if ([commandName isEqualToString:@"requestCaretRect"]) { #if RCT_DEBUG if ([args count] != 1) { RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedMarkdownTextInput", commandName, (int)[args count], 1); return; } #endif NSObject *arg0 = args[0]; #if RCT_DEBUG if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"EnrichedMarkdownTextInput", commandName, @"1st")) { return; } #endif NSInteger requestId = [(NSNumber *)arg0 intValue]; [componentView requestCaretRect:requestId]; return; } #if RCT_DEBUG RCTLogError(@"%@ received command %@, which is not a supported command.", @"EnrichedMarkdownTextInput", commandName); #endif } @protocol RCTEnrichedMarkdownTextViewProtocol @end NS_ASSUME_NONNULL_END