// Copyright (c) 2019 Alibaba Group. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v3.2.9), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import <Foundation/Foundation.h>
@protocol FlutterBinaryMessenger;
@protocol FlutterMessageCodec;
@class FlutterError;
@class FlutterStandardTypedData;

NS_ASSUME_NONNULL_BEGIN

@class FBCommonParams;
@class FBStackInfo;
@class FBFlutterContainer;
@class FBFlutterPage;

@interface FBCommonParams : NSObject
+ (instancetype)makeWithOpaque:(nullable NSNumber *)opaque
    key:(nullable NSString *)key
    pageName:(nullable NSString *)pageName
    uniqueId:(nullable NSString *)uniqueId
    arguments:(nullable NSDictionary<NSString *, id> *)arguments;
@property(nonatomic, strong, nullable) NSNumber * opaque;
@property(nonatomic, copy, nullable) NSString * key;
@property(nonatomic, copy, nullable) NSString * pageName;
@property(nonatomic, copy, nullable) NSString * uniqueId;
@property(nonatomic, strong, nullable) NSDictionary<NSString *, id> * arguments;
@end

@interface FBStackInfo : NSObject
+ (instancetype)makeWithIds:(nullable NSArray<NSString *> *)ids
    containers:(nullable NSDictionary<NSString *, FBFlutterContainer *> *)containers;
@property(nonatomic, strong, nullable) NSArray<NSString *> * ids;
@property(nonatomic, strong, nullable) NSDictionary<NSString *, FBFlutterContainer *> * containers;
@end

@interface FBFlutterContainer : NSObject
+ (instancetype)makeWithPages:(nullable NSArray<FBFlutterPage *> *)pages;
@property(nonatomic, strong, nullable) NSArray<FBFlutterPage *> * pages;
@end

@interface FBFlutterPage : NSObject
+ (instancetype)makeWithWithContainer:(nullable NSNumber *)withContainer
    pageName:(nullable NSString *)pageName
    uniqueId:(nullable NSString *)uniqueId
    arguments:(nullable NSDictionary<NSString *, id> *)arguments;
@property(nonatomic, strong, nullable) NSNumber * withContainer;
@property(nonatomic, copy, nullable) NSString * pageName;
@property(nonatomic, copy, nullable) NSString * uniqueId;
@property(nonatomic, strong, nullable) NSDictionary<NSString *, id> * arguments;
@end

/// The codec used by FBNativeRouterApi.
NSObject<FlutterMessageCodec> *FBNativeRouterApiGetCodec(void);

@protocol FBNativeRouterApi
- (void)pushNativeRouteParam:(FBCommonParams *)param error:(FlutterError *_Nullable *_Nonnull)error;
- (void)pushFlutterRouteParam:(FBCommonParams *)param error:(FlutterError *_Nullable *_Nonnull)error;
- (void)popRouteParam:(FBCommonParams *)param completion:(void(^)(FlutterError *_Nullable))completion;
/// @return `nil` only when `error != nil`.
- (nullable FBStackInfo *)getStackFromHostWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)saveStackToHostStack:(FBStackInfo *)stack error:(FlutterError *_Nullable *_Nonnull)error;
- (void)sendEventToNativeParams:(FBCommonParams *)params error:(FlutterError *_Nullable *_Nonnull)error;
@end

extern void FBNativeRouterApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<FBNativeRouterApi> *_Nullable api);

/// The codec used by FBFlutterRouterApi.
NSObject<FlutterMessageCodec> *FBFlutterRouterApiGetCodec(void);

@interface FBFlutterRouterApi : NSObject
- (instancetype)initWithBinaryMessenger:(id<FlutterBinaryMessenger>)binaryMessenger;
- (void)pushRouteParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)popRouteParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)removeRouteParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)onForegroundParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)onBackgroundParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)onNativeResultParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)onContainerShowParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)onContainerHideParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)sendEventToFlutterParam:(FBCommonParams *)param completion:(void(^)(NSError *_Nullable))completion;
- (void)onBackPressedWithCompletion:(void(^)(NSError *_Nullable))completion;
@end
NS_ASSUME_NONNULL_END
