Files
flipper/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutDescriptor.h
Dustin Shahidehpour 7711502413 Add ability to register additional attribute providers.
Summary:
We have some "internal-only" stuff we want to put in the attribute of a layout node.
This allows us to do so a way that keeps it out of open-source and avoid the clunky subclassing.

Reviewed By: adamjernst

Differential Revision: D24162047

fbshipit-source-id: 518ab9fbf0b4274076f5b0ae1b249e197563fa7f
2020-10-07 15:41:44 -07:00

31 lines
828 B
Objective-C

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <FlipperKitLayoutPlugin/SKNodeDescriptor.h>
#import "SKSubDescriptor.h"
@class SKComponentLayoutWrapper;
typedef SKNamed* (*SKAttributeGenerator)(SKComponentLayoutWrapper* node);
@interface SKComponentLayoutDescriptor
: SKNodeDescriptor<SKComponentLayoutWrapper*>
+ (void)registerSubDescriptor:(SKSubDescriptor)descriptor
forName:(NSString*)name;
/**
Allows you to 'plug-in' additional logic to update the attribute
string displayed for a node.
You can return a `nil` object from this, it will be gracefully ignored.
*/
+ (void)registerAttributeGenerator:(SKAttributeGenerator)generator;
@end